Results 1 to 3 of 3
  1. #1
    sidster is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Default Problem with JSP exception handling page

    Hi All.I'm new to JSP's.

    I have a problem working with JSP exception handling page.

    My index page(index.jsp) was: <html>
    <head></head>
    <body>
    <table align="center" border=1>

    <form action="jspex/formHandler.jsp" method = "post">
    <tr><td>Enter your first Number: </td>
    <td><input type="text" name="fno" /></td></tr>
    <tr><td>Enter your Second Number: </td>
    <td><input type="text" name="sno" /></td></tr>
    <tr ><td colspan="2">
    <input type="submit" value="Submit" /></td></tr>
    </form>
    </table>
    </body>
    </html>

    I tried to post to formHandler.jsp which throws an exception.

    formHandler.jsp

    <%@ page errorPage="exceptionHandler.jsp" %>
    <html>
    <head></head>
    <body>

    <%
    int fno;
    int sno;
    fno = Integer.parseInt(request.getParameter("fno"));
    sno = Integer.parseInt(request.getParameter("sno"));
    int div=fno/sno;
    %>

    </body>
    </html>

    The ExceptionHandler is

    exceptionHandler.jsp

    <%@ page isErrorPage="true" %>

    <% System.out.println("im here at the exception handler"); %>
    <body>
    Welcome to the exception page
    </body>

    when I run this application I could see the debugging statement "im here at the exception handler" printed on the log.But my JSP is not displayed with the welcome statement.I see the InternalServer error page being displayed.

    Could someone please tell me if i'm missing something.

    Thanks in Advance.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Really, it has nothing to do with jsp, and everything to do with properly formed html.

  3. #3
    sidster is offline Member
    Join Date
    Jun 2008
    Posts
    2
    Rep Power
    0

    Default

    I tried it with proper HTML (including head ,html tags) but the result is same. :(

Similar Threads

  1. JAXP exception handling
    By jovenky in forum Advanced Java
    Replies: 0
    Last Post: 05-27-2008, 01:37 PM
  2. Exception Handling...
    By focus_nitin in forum New To Java
    Replies: 1
    Last Post: 02-16-2008, 03:13 AM
  3. JDBC - Exception handling
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-05-2007, 04:00 PM
  4. Jstl Exception Handling
    By vamsidharpoosarla in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 07-18-2007, 06:17 AM
  5. JSTL Exception Handling
    By chaatf in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-18-2007, 02:24 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
  •