• Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts 1.3: A good way to save the latest search parameters  RSS feed

 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a simple search form with 6 parameters.

After the search is done, the user has the option to click "delete" on one of the results and delete a record. After Delete, I want to send user back to repeat the search with the same search parameters. I can do this in a brute force fashion, but I wonder if there is an established way in struts to reuse the search form bean?

I've Done the following:
save search form bean in session and use it if the app finds itself at the search results action with a null search form. (the search form is never null, so I check for null fields). If all the fields are null, then I revert to using the search form saved in the session.

while this works, it seems over complicated and I'm writing to see if there is another way.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!