<% page import .... %>
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   garfield_11
Posted On:   Thursday, September 5, 2002 12:25 AM

Hi all, I'm new in JSP and totally no idea how it works. So far I was able to load the driver and get a connection to the database already. That's great! Now the problem is I have created a package called "myappli" and placed it in C: omcatwebappsROOT. In it I created another folder called "classes" where all my .java/class files are stored. Under JPadPro menu, I set the standard classpaths as: \WESTPOINTMicrosoft_SQL_Server_2000_Driver_for_JDBClibmsbase.jar \WESTPOINTMicrosoft_SQL_Server_2000_Driver_for_JDBClibmssqlserver.jar \WESTPOINTMicrosoft_SQL_Server_2000_Driver_for_JDBClibmsutil.jar \WESTPOINT omcatlibservlet.jar So far I created Employee.java/class n Emp   More>>

Hi all,

I'm new in JSP and totally no idea how it works. So far I was able to load the driver and get a connection to the database already. That's great!

Now the problem is I have created a package called "myappli" and placed it in C: omcatwebappsROOT. In it I created another folder called "classes" where all my .java/class files are stored.

Under JPadPro menu, I set the standard classpaths as:
\WESTPOINTMicrosoft_SQL_Server_2000_Driver_for_JDBClibmsbase.jar
\WESTPOINTMicrosoft_SQL_Server_2000_Driver_for_JDBClibmssqlserver.jar
\WESTPOINTMicrosoft_SQL_Server_2000_Driver_for_JDBClibmsutil.jar
\WESTPOINT omcatlibservlet.jar

So far I created Employee.java/class n Employee.jsp and import as like <%@ page import = "myappli.Employee" %> and view it in http://localhost:8080/myappli/Employee.jsp but i encountered error -

org.apache.jasper.JasperException: Unable to compile class for JSPC: omcatworklocalhost_8080\_0002fmyappli_0002fEmployee_0002ejspEmployee_jsp_0.java:15: Class myappli.Employee not found in import.
import myappli.Employee;
^
1 error

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:258)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:268)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Unknown Source)

Can anyone please advise? Thanks!

Love_Garfield

   <<Less

Re: &lt;% page import .... %&gt;

Posted By:   zhou_peng  
Posted On:   Thursday, September 5, 2002 02:53 AM

you use tomcat.
where did you put your jsp page?
If you put your jsp page in $tomcat_home/ROOT directory,you should create a directory named WEB-INF,then add the classes directory in it.And stored your all classes into the ROOT/WEB-INF/classes/.
Generally,we created a new directory in $tomcat_home/webapps.You can call it everything you want but you have to add it at $tomcat_home/conf/server.xml.for example,name is test.
And you have to created some directory in $tomcat_home/webapps/test.To your question,
$tomcat_home/webapps/test/WEB-INF/classes stored your classes.
About | Sitemap | Contact