JSP help, please.

Discussion in 'Java' started by Jason, Apr 6, 2004.

  1. Jason

    Jason Guest

    Hi, all,
    I have two JSP pages, one is searchCriteria.jap and another is
    searchResults.jsp,
    I need to have two buttons in searchResults.jsp (revsie and new search), here is
    my question:
    in searchCriteria.jsp, if user typed '123456780' in SSN field, then displayed
    nothing in searchResults.jsp becasue there is no such SSN in database, then when
    user click 'Revise' button in searchResults.jsp, how can I pass current
    SSN(123456780) to searchCriteria.jsp, that user can see what's wrong and
    modified 123456780' to '123456789'? Do I need another JSP file to handle this
    request or same file(searchCriteria.jsp) can do this?

    please help.

    Thanks in advance.
    Jason
     
    Jason, Apr 6, 2004
    #1
    1. Advertising

  2. Hi,

    > in searchCriteria.jsp, if user typed '123456780' in SSN field, then displayed
    > nothing in searchResults.jsp becasue there is no such SSN in database, then when
    > user click 'Revise' button in searchResults.jsp, how can I pass current
    > SSN(123456780) to searchCriteria.jsp, that user can see what's wrong and
    > modified 123456780' to '123456789'? Do I need another JSP file to handle this
    > request or same file(searchCriteria.jsp) can do this?


    use the request.setAttribute method to pass the search value to the
    request stream before forwarding the request to your searchCriteria.jsp.
    In searchCriteria.jsp use the request.getAttribute method to retrieve
    the passed value (will be null if there is none).

    cu
    Dirk
     
    Dirk Michaelsen, Apr 6, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    4
    Views:
    567
    Chris Uppal
    May 5, 2005
  2. KK
    Replies:
    2
    Views:
    721
    Big Brian
    Oct 14, 2003
  3. MuZZy
    Replies:
    7
    Views:
    1,829
    Mike Hewson
    Jan 7, 2005
  4. Replies:
    0
    Views:
    4,544
  5. mera
    Replies:
    7
    Views:
    1,158
Loading...

Share This Page