why can't my jsp use this bean?
hi,
i'm stuck with this problem since yesterday. hope anyone can help me sort this out. i'll try to state my problem here as clear as possible...
i have a jsp page named call.jsp which i put in the folder
C:\Tomcat 5.5\webapps\ROOT\mypage\
here's the content (partially) of the call.jsp
<%@ pageimport ="login.*" %>
<jsp:useBean id="mybean" class="login.loginDB"/>
and here's the content of the bean which this call.jsp is trying to call. name of the bean is loginDB.java. i put the the loginDB.java inside this folder:
C:\Tomcat 5.5\webapps\ROOT\mypage\WEB-INF\classes\login
then i compiled the java file using the command prompt
C:\Tomcat 5.5\webapps\ROOT\mypage\WEB-INF\classes\login\javac loginDB.java
and so the output is loginDB.class which obviously is placed in the folder C:\Tomcat 5.5\webapps\ROOT\mypage\WEB-INF\classes\login\
here's the content of loginDB.java:
package login;
import java.sql.*;
import java.util.*;
publicclass loginDBimplements java.io.Serializable{
private String dbServer ="localhost";
private String dbName ="toyo-SMP";
//getter
public String getdbServer(){
return dbServer;
}
public String getdbName(){
return dbName;
}
}
so the problem is, everytime i call call.jsp, this error will come out:
org.apache.jasper.JasperException: /SMP-toyo/logoutPekerja.jsp(85,0) The valuefor the useBeanclass attribute login.loginDB is invalid.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
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)
i don't know what else should i to. thanks a lot for helping.
btw i'm using tomcat 5.5.20 with jdk 1.5

