Results 1 to 4 of 4

Thread: Going back to previous page

  1. #1
    Join Date
    Oct 2006
    Posts
    27

    Default 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. #2
    Join Date
    Jan 2007
    Location
    Orlando, FL USA
    Posts
    84

    Default

    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.
    http://www.jroller.com/thebugslayer - notes on java, scala and other development stuff.

  3. #3
    Join Date
    Oct 2006
    Posts
    27

    Default

    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

  4. #4
    Join Date
    Jan 2007
    Location
    Orlando, FL USA
    Posts
    84

    Default

    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
    http://www.jroller.com/thebugslayer - notes on java, scala and other development stuff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •