I've found a strange problem while trying the create a class called Test, was compiled and placed in WEB-INF/classes of my web root and wen I tried to access it from the index.jsp page like <% Test t = new Test(); out.print(t.getString()); %>. It doesn't seems to work. This is my class.
public Test{
public Test(){}
public getString(){
return "It's working";
}
}
I tried with different different stuff... for example I tried <%@ page import="Test" %>. It didn't work :(. But this worked when I put the Test file in a package called test.(Thus WEB-INF/classes/test/Test.class). Anyway I'm curious why it didn't work in first place. I always restarted the Tomcat(5.5/windows) when ever I made a change. Also I even tried with deleting catalina every and each time. Nothing worked for me... Hope someone knew :(
No comments:
Post a Comment