Twitter
- The Bridge http://flic.kr/p/8okJwJ 3 hrs ago
- More updates...
Posting tweet...
Categories
Archives
Tags
Apache Bear Creek dabbledb database DbUnit development eclipse framework game gem general hosting how-to interview j2ee Java javascript jboss jquery linux maven MVC netbeans OS X prgmr programming rant RegEx review ruby selenium Skiing Snowboarding Software source code Spring tapestry thoughts Tocol unix web Wicket wtp xen
July 2008
Calling different methods via submit buttons using Spring MVC
Using Spring 2.5 annotation, you can specify different buttons like so:
<input type="submit" name="save" value="Save" />
<input type="submit" name="saveAndContinue" value="Save and Continue" />
In your controller, you can handle this like so
@RequestMapping(params = "saveAndContinue", method = RequestMethod.POST)
public String saveAndContinue() {
save(request);
return "redirect:/newPage.html";
}
@RequestMapping(params = "save", method = RequestMethod.POST)
public String save() {
[...]