aspose file tools*
The moose likes Other Application Frameworks and the fly likes SPRING query: how to have more than one successview Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "SPRING query: how to have more than one successview" Watch "SPRING query: how to have more than one successview" New topic
Author

SPRING query: how to have more than one successview

Ashimashi Kabashi
Ranch Hand

Joined: Sep 11, 2006
Posts: 84
I have a spring controller class and I have set it's success view to a jsp page.
This binds the spring container to show the page mentioned in the success view on a form submit. But I want it to redirect based on some logic (like how struts does it for us with the ability to add multiple forwards for a single ActionClass ).

my controller class is:
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You'd put the logic in onSubmit(). All you'd need to do is return whatever view you want from this method, wrapped in a ModelAndView.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Ashimashi Kabashi
Ranch Hand

Joined: Sep 11, 2006
Posts: 84
excellent ... Thanks
Sudhana Madhu
Greenhorn

Joined: Aug 20, 2007
Posts: 8
my doubt is how can we create another view (except formView and successView)?
can any body post the sample code for this ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

Originally posted by MadhuE sudhana:
my doubt is how can we create another view (except formView and successView)?
can any body post the sample code for this ?


What do you mean another view. If you want another view you put that view name in the ModelAndView object, or just reset the success or form view.

I don't think you need more, without convoluting the api.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Sudhana Madhu
Greenhorn

Joined: Aug 20, 2007
Posts: 8
got it
we can
viewName can be resolved based on the ViewResolver prefix and suffix properties.
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SPRING query: how to have more than one successview