File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes RequestDispatcher  method is not working. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "RequestDispatcher  method is not working." Watch "RequestDispatcher  method is not working." New topic
Author

RequestDispatcher method is not working.

sumanta panda
Ranch Hand

Joined: Jun 23, 2008
Posts: 224
Dear Sir,
I am calling procedure in my servlet program.The procedure returns correct valule.
For example
  • 1
    If the Logid id wrong then errorType Returns E and errorDesc LOGIN ID IS NOT AVAILABLE.
    i am set this error message request.setAttribute("errorLogin", "Invalid Login ID") and forward to /help/NewPassword.jsp
  • 2
    If the Date of Birth wrong then errorType Returns E and errorDesc DOB IS NOT AVAILABLE.
    i am set this error message request.setAttribute("errorDob", "Invalid Date of Birth") and forward to /help/NewPassword.jsp



  • I am getting proper return type from procedure.This server log.
    [16/Jan/2009:19:20:56] info ( 3972): CORE3282: stdout: errorType...->E
    [16/Jan/2009:19:20:56] info ( 3972): CORE3282: stdout: errorDesc...->ERROR:OB IS NOT AVAILABLE

    But while forwarding same errormsg to jsp using the syntax it is not forwarded to jsp.No exception comming.But help/NewPassword.jsp this also exist.The blank is comming.
    request.setAttribute("errorDob", "Invalid Date of Birth");
    strJspCalled =response.encodeRedirectURL("/help/NewPassword.jsp");

    The code is given below.Could you please rectify my code/guide me for the needful.



    Thanks and Regards
    Sumanta Panda
    Bauke Scholtz
    Ranch Hand

    Joined: Oct 08, 2006
    Posts: 2458
    Read the appserver logs and read the HTML source.

    What does they say?
    sumanta panda
    Ranch Hand

    Joined: Jun 23, 2008
    Posts: 224
    Dear Bauke Scholtz,
    I did n't understand regarding this point Read the appserver logs and read the HTML source. I have already post the server
    log here
    This server log.
    [16/Jan/2009:19:20:56] info ( 3972): CORE3282: stdout: errorType...->E
    [16/Jan/2009:19:20:56] info ( 3972): CORE3282: stdout: errorDesc...->ERROR:OB IS NOT AVAILABLE


    Could you please suggest me for the needful.

    Thanks in advance.

    Regards
    Sumanta Panda
    Bauke Scholtz
    Ranch Hand

    Joined: Oct 08, 2006
    Posts: 2458
    You normally run JSP/Servlet in an application server. A decent application server logs info and errors to some log file. Generally in a straightforward location like in /logs folder. Take a look there. Check if you don´t see any important information like warnings, exceptions or stacktraces being logged during startup and requesting the page.

    And JSP/Servlet normally outputs plain vanilla HTML. Check the page source in your webbrowser to see if there is any HTML outputted. If so, then check what is already been outputted and what not. Check if you don´t miss parts or see unexpected parts.

    With the given information you can just think logically and fix the problem accordingly.
    sumanta panda
    Ranch Hand

    Joined: Jun 23, 2008
    Posts: 224
    Dear Bauke Scholtz,

    Accoding to your advise i am experimenting my code .

    Sir in this code, for always the else part error message forward to jsp page .Now the error message is displaying the jsp.

    For eg. even the error is LOGIN ID IS NOT AVAILABLE but in jsp it is showing DOB Is not available.

    Proper error message is comming.Forward time only else conditition message sended.

    Bauke, i request you please guide me for the needful.

    Thanks in advance.

    Regards
    Sumanta Panda

    sumanta panda
    Ranch Hand

    Joined: Jun 23, 2008
    Posts: 224
    Dear All,
    i request you to all please advise me for the above needful.


    Thanks in advance.
    Regards
    Sumanta Panda
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: RequestDispatcher method is not working.