jsp page doesn't find class
Hi
I'm new to web development so I'm sure this problem has a really easy solution (although its bugged me for days now).
I have created a simple web application with eclipse and tomcat consisting of an html page (index.html) with a link to a jsp page (testpage.jsp) my test page calls a class (numtest.class) which should simply return a number to print on the screen.
Now on my computer all this runs fine however when I upload this app to my virtual server (with godaddy.com) suddenly my testpage.jsp goes bezerk -instead of printing out the number I see in my browser the xml code of testpage.jsp!
Now I think that my file structure is OK: I put the app into the 'webapp' folder in the server and my java class is under 'myapp/WEB-INF/classes/mypackage/myclass' where it is supposed to be.
I'm sure the app can't find my class since when I delete the class from the server I still get the same results.
Sorry for the long question ,
Heeeeeeeelp!
Thanks
Aharon
[1034 byte] By [
Aharona] at [2007-11-27 9:12:57]

# 1
>see in my browser the xml code of testpage.jsp
add this to your web.xml
<security-constraint>
<display-name>Restrict raw JSP Documents</display-name>
<web-resource-collection>
<web-resource-name>JSP</web-resource-name>
<url-pattern>*.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>NONE</role-name>
</auth-constraint>
</security-constraint>
>I'm sure the app can't find my class since when I delete the class from the server I still get the same results
add <%@ page import="mypackage.myclass" %>
to the top of your jsp where you use the myclass
# 2
Thanks but I don't think there is a problem with my code, the problem is with the server.
I made the changes you mentioned but still no luck.
I have my app in the public_html folder on the server so probably all it sees is my index.html file and nothing else.
When I try moving my app into the 'webapps' folder not even the index.html file is found in the browser, Although in the tomcat admin app it IS visible as a context. How can I activate the app?
Thanks again