Make sure that the CheckUser.class file is in Tomcat's CLASSPATH.

Joseph Okomba wrote:

> Help please. I am new to JSP and Tomcat.
>
> I have written a Java class which compiles and runs properly from the
> command prompt, but gives errors when I try to load it in a JSP file. This
> is how I am loading the class:
>
> <%@ page session="true" %>
> <%@ page language="java" import="java.io.*" %>
> <jsp:useBean id="checkUser" scope="request" class="CheckUser" />
> <%
> boolean permit = false;
>  String strUserid = request.getParameter("userid");
>  String strPasswd = request.getParameter("passwd");
>
> if ((strUserid.equals("")) || (strPasswd.equals(""))){
>         permit = false;
> } else {
>
> permit = checkUser.authenticate(strUserid, strPasswd);
>
> } //end-else
>
> if(!permit){  // the user has permission
> %>
> <jsp:forward page="login.jsp?userid=<%=strUserid %>" />
> <%
> } //end if
> else {
> %>
>
> And the following is the error I am getting:
>
> Internal Servlet Error:
> org.apache.jasper.JasperException: Unable to compile class for
> JSPE:\jakarta-tomcat\work\localhost_8080%2Fmembers\_0002findex_0002ejspindex
> _jsp_92.java:74: Class CheckUser not found.
>                 CheckUser checkUser = null;
>                 ^
> E:\jakarta-tomcat\work\localhost_8080%2Fmembers\_0002findex_0002ejspindex_js
> p_92.java:77: Class CheckUser not found.
>                     checkUser= (CheckUser)
>                                 ^
> E:\jakarta-tomcat\work\localhost_8080%2Fmembers\_0002findex_0002ejspindex_js
> p_92.java:82: Class CheckUser not found.
>                             checkUser = (CheckUser)
> Beans.instantiate(getClassLoader(), "CheckUser");
>                                          ^
> 3 errors
>
> I will appreciate any assistance.
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to