Announcement Announcement Module
Collapse
No announcement yet.
Going back to previous page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Going back to previous page

    Hi,
    I am using spring MVC.
    I have a search page controller(type level annotated), wihich would diplay the search result.From the search result page, i can go to the detail page where I shows the detaild of the each search result.
    Now what I would like to do is I want to come back to the search page from the details page.When I am coming back I need to show the user the result of his previous search.I know I am asking too much,but does anybody have a suggestion how to do this using spring mvc .

    Thanks in advance

    Shaiju

  • #2
    Hello Shaiju,

    So you have 3 pages A=formView, B=succesView, C=detailSearchView, and you want to redisplay B?

    If you have a formController providing A&B, and second detailController providing C, then there is no reason why you can't just simply redirecting back to formController, except that you might want to support GET in formController to process the form/paramesters instead of POST. Use #isFormSubmitt method to control this.

    Hope this helps.

    Comment


    • #3
      Hi,
      Thanks for the response!!!
      The scenario is exactly same as you assumed.
      I have Controller A for rendering and processing the search page(a user search page).Controller B for rendering the detailed Page.
      From the search page I capture the user entered data in a SearchCriteria class object and the controler A process the submit request and renders the search result.Once I navigate to the detailed page ,I am losing the user selected/entered search criteria and hence when redirecting back to the controller A it renders the whole list of the users iirespective of the user selected criteria,as the application already lost the user slected criteria.I may be able to do this by storing the criteria in the session.But this is the least thing I wanted to do.

      Shaiju

      Comment


      • #4
        Hello Shaiju,
        Like I said earlier, you want to make ControllerA to process your form with GET url parameters as well as POST. Since you don't want save data through session, then your only option is to carry the search criteria through URL string. Just add a action param to indicate for process or something similar.

        Cheers,
        -Z

        Comment

        Working...
        X