默认情况下,在春天创建对象而不使用@modelattribute

时间:2017-01-30 05:33:56

标签: spring spring-mvc

我有一个弹簧控制器类方法,如下所示

@RequestMapping(value = "/users", method = RequestMethod.POST)
public String saveOrUpdateUser(Pojotest pojotest,@ModelAttribute("userForm") User user,String s,
            BindingResult result, Model model, final RedirectAttributes redirectAttributes) 

我没有宣布Pojotest类@ModelAttribute,但仍然创建了一个默认对象,但它应该为null,因为它是一个普通的Pojo类。

任何人都可以帮我解决这个问题。

0 个答案:

没有答案