Results 1 to 3 of 3
  1. #1
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

    Lightbulb SEVERE: Allocate exception for servlet ServletHandler

    hi,
    i'm new to JSP and Servlets. I have written a JSP login page and i'm processing those data through a Servlet. But i get this exception when i submit the login page. SEVERE:
    Allocate exception for servlet ServletHandler
    java.lang.ClassNotFoundException: ServletHandler

    This is my login page
    <form action="ServletHandler" method="post">
    <table width="350" border="0">
    <tr><td>User name</td><td><input type="text" name="uname"/></td></tr>
    <tr><td>Password</td><td><input type="password" name="pword"/></td></tr>
    <tr><td></td><td>New User<input type="checkbox" name="new"/></td></tr>

    <tr><td></td><td><input type="submit" value="Login"/><input type="reset" value="Cancel"/></td></tr>
    </table>
    </form>

    and "ServletHandler" is the Servlet class
    There i have implemented the doPost and doGet methods.

    And also i edited the web.xml by adding following lines

    <servlet>
    <description></description>
    <display-name>ServletHandler</display-name>
    <servlet-name>ServletHandler</servlet-name>
    <servlet-class>ServletHandler</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ServletHandler</servlet-name>
    <url-pattern>/ServletHandler</url-pattern>
    </servlet-mapping>

  2. #2
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    368
    Rep Power
    5

    Default

    Is that Servlet class in some package?

    You need fully-qualified class name of the servlet in servlet-class tag
    in web.xml

    Java Code:
    ...
    <servlet-class>
    package.foo.MyServlet
    <servlet-class>
    ...

    TIP: When you write servlet always test it first. Just write some simple
    System.out messages in doGet() and doPost() that you can track in console and hit URL like

    http://localhost:8080/myapp/ServletHandler

    to see if its working

    cheers!

  3. #3
    shyameni is offline Member
    Join Date
    Jul 2009
    Location
    Kandy, Sri lanka
    Posts
    16
    Rep Power
    0

Similar Threads

  1. Servlet Exception
    By bhanupriya in forum Java Servlet
    Replies: 10
    Last Post: 03-05-2010, 07:05 PM
  2. SEVERE: Error filterStart
    By mvv in forum Java Servlet
    Replies: 3
    Last Post: 01-15-2010, 05:51 PM
  3. Replies: 2
    Last Post: 12-09-2009, 10:58 AM
  4. Replies: 4
    Last Post: 11-05-2007, 06:14 PM
  5. A Servlet Exception Has Occurred
    By gabriel in forum JDBC
    Replies: 1
    Last Post: 08-07-2007, 03:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •