Spring MVC控制器方法参数如何工作?
问题内容:
我使用从STS创建的模板创建了Spring MVC项目,这是在控制器中生成的:
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
//stuff
}
我的问题是,locale
and model
变量如何传递到home
方法中?
另外,可以传递给方法的对象的可能选项是什么?
问题答案: