Redundant parameter in Spring controller method?

谁都会走 提交于 2019-12-12 05:37:42

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!