You need a ModelAttribute ... in the create ModelAttribute controller
@ModelAttribute("prj")
public ProjektSuche projektSearchForm() {
if (searchForm == null) {
searchForm = new ProjectSearch();
}
return searchForm;
}
and the form has a modelAttribute attribute, for example:
<form:form method="get" modelAttribute="prj" action="${urlStartSearch}">
...
</form>
prj is the name you selected in the previous step. The request handler method (the same controller) looks something like this:
public ModelAndView startProjektSuche(@Valid @ModelAttribute("prj") ProjektSuche prjSearch, BindingResult result) {
...
}
source
share