jsp and java class unhappiness (newbie question)

T

tiewknvc9

Hi!

I know java well, however I am new at making java integrate with JSP.

What I have done, is created a class file (test.class) in a package
called testThis.

the test object contains an empty constructor, and is used to access
utility funcitons in the class file.

So testThis.test would lead me directly to the test object.

in my jsp application (running on tomcat), I have
<% @page import="java.io.*, testThis.*" %>
as my import statement.

my class is currently located in the classpath, AND in the
Tomcat\apache-tomcat-5.5.17\shared\classes folder AND in the
WEB-INF\classes folder. I just dont know what I am doing wrong...

thanks in advance!

When I try to run the page I get the following page exception...


org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 6 in the jsp file: /purchase/fileupload.jsp
Generated servlet error:
test cannot be resolved to a type

An error occurred at line: 6 in the jsp file: /purchase/fileupload.jsp
Generated servlet error:
test cannot be resolved to a type


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 
S

sdavids

So testThis.test would lead me directly to the test object.
in my jsp application (running on tomcat), I have
<% @page import="java.io.*, testThis.*" %>
as my import statement.

my class is currently located in the classpath, AND in the
Tomcat\apache-tomcat-5.5.17\shared\classes folder AND in the
WEB-INF\classes folder. I just dont know what I am doing wrong...

#1 you dont need to import java.io, you just use <%
out.println("text"); %>
#2 do you have the .CLASS and .java file located at:
\WEB-INF\classes\testThis\
#3 did you alter your server.xml file at all?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top