File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Search Page - question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Search Page - question" Watch "Search Page - question" New topic

Search Page - question

Sumithab Baskaran
Ranch Hand

Joined: Oct 29, 2004
Posts: 52
I have a search page with the following parameters.

Search by Name: (textbox)

Search by SSN: (textbox)

Search by Zipcode: (textbox)

The user enters info in the textboxes and hits the search button. It takes the user to the searchResults page that displays the list. This searchResults page has a "New Search" button. When the user hits this button, the search page is displayed, but with empty textboxes. What should I do to store the entered information and display it when they hit the "New Search" button?
for example, in the search page, if they enter Search by zipcode as "55535" and hit the search button. a list is displayed in the searchResults page. When they hit the "New Search" button, now it should go back to the search page and contain the zipcode "55535" in that textbox.

Any suggesstions?
Bimal Patel
Ranch Hand

Joined: Aug 29, 2003
Posts: 130
Sessions? Or hidden fields? More elaborately, by session, you can store the search fields which can be retrieved anywhere till the session lives. Or, by other way, you can probably store the search criteria a in the search result page by hidden fields and then while submitting to the previous page again i.e. search page, try to retrive values came from the request parameter in the main search criteria page and then fill those textboxes with such values! By this, you can avoid session. But you need to take care that if there are no values of such parameters, fill the text boxes by "". I hope you are able to understand what I mean to explain!

Work Hard, Expect The Worst...<br /> <br />Bimal R. Patel<br />(SCJP 1.2, SCWCD 1.4)
Jason Liao
Ranch Hand

Joined: Jun 17, 2005
Posts: 59
I am afraid "hidden fields" is better.
I agree. Here's the link:
subject: Search Page - question
It's not a secret anymore!