Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

jsp and java class unhappiness (newbie question)

Thread view: 
tiewknvc9 - 14 Jun 2006 17:29 GMT
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)
sdavids - 14 Jun 2006 21:25 GMT
> So testThis.test would lead me directly to the test object.
>
[quoted text clipped - 5 lines]
> 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?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.