问题
I have createForm, which is displayed to user. As you can presume it is empty form and the user has to fill it with information. In my controller I have, the following code:
@RequestMapping(value = {"", "/"}, method = RequestMethod.GET, params = "mode=create")
public ModelAndView showCreatePage(@Nonnull @ModelAttribute("createForm") ApplicationCreateForm form)
throws ClientException {
return customMethod("ApplicationController/create");
}
We do not need to populate the form with the information to be present to the user all fields are empty, so why I need to specify in the metod ApplicationCreateForm form as method parameter? Is it unnecessary, or Spring use in some way?
来源:https://stackoverflow.com/questions/29031282/redundant-parameter-in-spring-controller-method