NagaRama Krishna
NagaRama Krishna

Reputation: 35

JSP pages retaining values

I have a JSPage(say Search page) in which there are few drop down lists and a search button. Based on drop down list option selection search button will redirect to some other page(say Result page), which displays some content and buttons. One of the button is cancel, on clicking it, it will take back to before page(i.e. Search page). This is the scenario.

What I want is after getting back to previous page(i.e. Search page) I have to retain the values which was selected by user at the time of search. How can give me the idea of how to achieve it.

Upvotes: 0

Views: 401

Answers (1)

kukudas
kukudas

Reputation: 4934

When redirecting to the result page you can pass the selected elements as request parameters. When clicking "back" you could just pass these parameters back again. Your Search page would check if there are parameters if so select the appropriate values if not select some kind of default value.

Upvotes: 1

Related Questions