Results 1 to 3 of 3
  1. #1
    dilanka007 is offline Member
    Join Date
    Jan 2010
    Posts
    11
    Rep Power
    0

    Default forwarding to a servlett

    Hello,

    I am working on a simple login system.
    When a user doesn't type anything on login and submit i want that request to go to a controller and hence the user hasn't passed any information that servlet should go on to the same jsp and generate an error msg.

    how would i do that?
    i am a bit lost in session objects..

    thanks

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    you could do it with a request scope object too, such as if the servlet did a forward to the jsp, it could set an ERROR_MESSAGE request attribute, such as when the username / password fields from the jsp form was not entered or invalid. the JSP could have a block on it to try to read the ERROR_MESSAAGE request attribute, if i was present, print its contents out, in an appropriate spot such as above the form in the html templating.

  3. #3
    dilanka007 is offline Member
    Join Date
    Jan 2010
    Posts
    11
    Rep Power
    0

    Default need some explanation

    heyy culd you please give me few fractions of the code about what you said..
    well i am redirecting to a jsp here..

    so what should i have in my servlet and on jsp//

    f u can give me an example it will be great

Similar Threads

  1. Forwarding data problem with struts.xml
    By Shaolin in forum Web Frameworks
    Replies: 0
    Last Post: 01-08-2009, 06:29 AM
  2. Forwarding mails in message/rfc822
    By prithviraj in forum Advanced Java
    Replies: 0
    Last Post: 05-18-2008, 11:30 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
  •