"Class not found" in JSP import
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Lucky_Tian
Posted On:   Saturday, August 3, 2002 12:06 PM

I have a simple JSP page: <%@ page import="mypkg.mytest.*" %> <% Test t = new Test(); out.println(t.getMessage()); %> The Test class is indeed in WEB-INFclassesmypkgmytest, but when I request test.jsp, Tomcat gave me ClassNotFound error message saying class Test not found. And Tomcat shows import statment is wrong. I have set up the web application right(Test web application is n webapps dir and there is an entry in the server.xml), and I could run examples. Can someone kindly tell me what wrong it is? Thanks a lot. -LuckyTian    More>>

I have a simple JSP page:

			
<%@ page import="mypkg.mytest.*" %>


<% Test t = new Test();
out.println(t.getMessage());
%>




The Test class is indeed in WEB-INFclassesmypkgmytest,
but when I request test.jsp, Tomcat gave me ClassNotFound error message saying class Test not found. And Tomcat shows import statment is wrong.



I have set up the web application right(Test web application is n webapps dir and there is an entry in the server.xml), and I could run examples.



Can someone kindly tell me what wrong it is?
Thanks a lot.



-LuckyTian    <<Less

Re: "Class not found" in JSP import

Posted By:   dan_chan  
Posted On:   Tuesday, August 6, 2002 04:49 PM

testing testing

Re: "Class not found" in JSP import

Posted By:   Anonymous  
Posted On:   Tuesday, August 6, 2002 04:28 AM

Have you created a WEB-INF in the Test application's directory?

Re: "Class not found" in JSP import

Posted By:   Trex_Lim  
Posted On:   Tuesday, August 6, 2002 03:39 AM

LuckyTian:


Why not you try the following. If you have more than one class to include and they aren't that many, just specify them one by one seperated by comma. Hope this help. All the best!



<%@ language="java"

page import="mypkg.mytest.*" %>


or


<%@ language="java"

page import="mypkg.mytest.Test" %>

About | Sitemap | Contact