I managed to come up with a solution something like this
Code:
@RequestMapping ("/choice1")
public String one(@ModelAttribute("form") Form form) {
form.setApptype(1);
return "index";
}
@RequestMapping ("/choice2")
public String two(@ModelAttribute("form") Form form) {
form.setApptype(2);
return "index";
I don't actually have the views called choice1 and choice2, but the mapping works when I link to choice1.html and choice2.html from my radiobutton's onClick attribute. These methods call my index page again, which show the fields that are supposed to show, because I have <c:if>-clauses based on apptype value in my index.jsp.
Now my problem is, that I cannot get to my OnSubmit-method after choosing the radiobutton! I get the index view when clicking the submit button over and over again! Is there any easy way to solve this?