Link to home
Start Free TrialLog in
Avatar of laoyaobest
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.ClassNotFoundException: NameHandler.class
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java: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("username") != null ) {
      %>
      <%@ include file="response.jsp" %>
      <% }
      %>
</body></html>
Avatar of copyPasteGhost
copyPasteGhost
Flag of Canada image

your class files must be in the

web-inf/classes/packageName/MyClass.class
Hope that helps,
Ghost
also your class NameHandler must be in a package.
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.NameHandler.class" />
Avatar of laoyaobest
laoyaobest

ASKER

let me try!
it seems work but i need more time to try. thanks a lot. I will come back in  10 minutes.
ASKER CERTIFIED SOLUTION
Avatar of copyPasteGhost
copyPasteGhost
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it is ok. thanks!