I apologize if this is a ridiculous question, but I'm not really sure how
to check to make sure my class path is correct.
I did import java.sql.ResultSet in checklogin.jsp, so it should be
finding the ResultSet class.
Here is what I'm doing with my jsp's:
1. I'm using Tomcat 3.2.1/linux/apache
2. I created a context, /gamezone, so that I could place my .jsp files in
/home/httpd/html/gamezone and my JavaBean, ConnectionBean.java in
/home/httpd/html/gamezone/WEB-INF/classes.
I did this so I didn't have to put them in a subdirectory of
$TOMCAT_HOME/webapps
3. In both login.jsp, checklogin.jsp, and ConnectionBean.java, I import
java.sql.* In checklogin.jsp I also imported java.sql.ResultSet
According to the error(shown below), tomcat is receving the checklogin.jsp
but then it can't find the ResultSet class.
Is it b/c I placed the jsp's and the JavaBean in a directory other than
$TOMCAT_HOME/webapps?
If someone could help me from this point or even point me to documentation
that will help me figure this out, I would really appreciate it.
If you need more info from me, I'd be happy to provide it.
Thanks,
Luoi
On Tue, 17 Apr 2001, time out wrote:
> it is related to your class path and the fact that you did not import
> java.sql.ResultSet or something like that.
>
>
> At 16:48 04/17/2001 -0500, you wrote:
> >I'm using a JavaBean to communicate with a mysql database.
> >Here's what I do:
> >
> >1. login.jsp --> user enters ID and password; also when this page is
> >loaded the ConnectionBean is declared with scope="session"
> >
> >2. when the user hits "submit", the form sends the data to checklogin.jsp
> >where the submitted data is checked against the database.
> >
> >I'm getting an error though at checklogin.jsp
> >
> >***********
> >
> >Error: 500
> >
> >Location: /gamezone/checklogin.jsp
> >
> >Internal Servlet Error:
> >
> >org.apache.jasper.JasperException: Unable to compile class for
>
>>JSP/usr/java/jakarta-tomcat-3.2.1/work/localhost_8080%2Fgamezone/_0002fchecklogin_0002ejspchecklogin_jsp_0.java:91:
>
> >Class
> >ResultSet not found.
> > ResultSet results = connection.executeQuery(sql);
> > ^
> >1 error
> >
> > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
> > at
> > org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
> > at
> > org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
> > at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
> > at
> >
>org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
> > at
> > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
> > at
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> > org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > at
> > org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > at
> > org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
> > at
> > org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > at
> >
>org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java:160)
> > at
> > org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > at
> > org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > at java.lang.Thread.run(Thread.java:484)
> >
> >********************
> >
> >Here is the code I have in checklogin.jsp
> >
> >*********************
> >
> ><jsp:directive.page import="java.sql.*,java.sql.ResultSet"
> >errorPage="error.jsp" />
> ><jsp:useBean id="connection" class="ConnectionBean" scope="session" />
> >
> ><%
> >String p_ID = request.getParameter("player_id");
> >String p_passwd = request.getParameter("player_passwd");
> >connection.setAutoCommit(false);
> >String sql;
> >sql = "SELECT player_id, player_passwd FROM player WHERE player_id=" +
> >p_ID + " AND player_passwd=" + p_passwd;
> >ResultSet results = connection.executeQuery(sql);
> >
> >if( results.next() ) { %>
> > <% /* ID and password correct, forward to main page */ %>
> > <jsp:forward page="index.jsp" />
> ><% } else { %>
> > <% /* ID and password incorrect, forward to login.jsp to reenter login
> >info */ %>
> > <jsp:forward page="login.jsp" />
> ><% } %>
> >
> >**********************
> >Is there an obvious(or not so obvious) reason why the jsp can't find the
> >ResultSet class?
> >
> >Thanks,
> >Luoi
> >
> >btw. I'm using Tomcat 3.2.1/linux/apache
> > my jsp's are located in /home/httpd/html/gamezone rather than
> > $TOMCAT_HOME/webapps/
> >
> >
> >--
> >D. Shun-Luoi Fong
> >821 Melrose Avenue
> >Iowa City, IA 52246
> >email: [EMAIL PROTECTED]
> >
> >-----------------------
> >Colossions 2:8 See to it that no one takes you captive through philosophy
> >or empty deception, according to the traditions of men, according to the
> >elementary principles of the world, rather than according to Christ.
> >-----------------------
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
--
D. Shun-Luoi Fong
821 Melrose Avenue
Iowa City, IA 52246
email: [EMAIL PROTECTED]
-----------------------
Colossions 2:8 See to it that no one takes you captive through philosophy
or empty deception, according to the traditions of men, according to the
elementary principles of the world, rather than according to Christ.
-----------------------