laoyaobest
asked on
tomcat & java.lang.ClassNotFoundException: NameHandler.class
I am learning the how to handle the html forms by java beans, but I always got the following error information: By a way, I can run applet without error.
java.lang.ClassNotFoundExc eption: NameHandler.class
org.apache.catalina.loader .WebappCla ssLoader.l oadClass(W ebappClass Loader.jav a:1383)
jsdk 1.4, tomcat 5.0, winXp, win2000(I have two computers.)
here is the code: thanks a lot!
<%@ page language="java" %>
<jsp:useBean id="mybean" class="NameHandler.class" />
<jsp:setProperty name="mybean" property="*" />
<html><head><title>Hello, User</title></head>
<body bgcolor="#000000">
<%@ include file="dukebanner.html" %>
<table border="0" width="700">
<tr><td width="550">
<form method="get" action = verify.jsp>
<input type="text" name="username" size="25">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</td></tr></table>
<%If ( request.getParameter("user name") != null ) {
%>
<%@ include file="response.jsp" %>
<% }
%>
</body></html>
java.lang.ClassNotFoundExc
org.apache.catalina.loader
jsdk 1.4, tomcat 5.0, winXp, win2000(I have two computers.)
here is the code: thanks a lot!
<%@ page language="java" %>
<jsp:useBean id="mybean" class="NameHandler.class" />
<jsp:setProperty name="mybean" property="*" />
<html><head><title>Hello, User</title></head>
<body bgcolor="#000000">
<%@ include file="dukebanner.html" %>
<table border="0" width="700">
<tr><td width="550">
<form method="get" action = verify.jsp>
<input type="text" name="username" size="25">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</td></tr></table>
<%If ( request.getParameter("user
%>
<%@ include file="response.jsp" %>
<% }
%>
</body></html>
also your class NameHandler must be in a package.
Ghost
Ghost
you can not use a bean class without a package in tomcat 5.0
package you class NameHandler is mypackage and then do
<jsp:useBean id="mybean" class="mypackage.NameHandl er.class" />
package you class NameHandler is mypackage and then do
<jsp:useBean id="mybean" class="mypackage.NameHandl
ASKER
let me try!
ASKER
it seems work but i need more time to try. thanks a lot. I will come back in 10 minutes.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it is ok. thanks!
web-inf/classes/packageNam
Hope that helps,
Ghost