This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I have a search page where i can select some criteria, say Name: xxx and click on search which gives multiple results. I select one of the record from search results and go to an other page. If I come back to search page, previous search results and sorting order is cleared. How can i retain my previous search results and sorting order?
Please advise me a best solution in Struts or Jsp...
When you are navigating to a different page from current search page, does it involves an action invocation.If yes,then the request object would be cleared or else if its just a page navigation it wont. It seems the Collection of results is set to request object, which clears itself when it moves to a different action.Try binding the collection to a session object instead.
Hey you need to save that parameters in session and get that url that gets created when you give some input and search results are displayed. that means you need to create same url again while coming back to the search result page again. The code can be like below. add in your action class of struts
********************************* //added by vijay jamadade for back button
********************************** request.getRequestURI()--- this will give you the current url you are working on and the remaining are the search criterias input
Regards, Vijay Jamadade.
( Nothing is Impossible.)
Hi Vijay, I didn't get any method getQueryStringURL() in ActionForm Class.Am using struts 1.2.9. Does such method is an ActionForm or any specific subclass of it.
create one string 'queryStringUrl' and getter setter method for this in form
*************************
//add in jsp one javascript fun function backToSearch(){ var queryStringUrl=emusterForm.queryStringUrl.value; emusterForm.action=queryStringUrl; emusterForm.method="post"; emusterForm.submit(); }
//call this fun onclick of back button this fun wil get the url created in action and display the same result page