我正在使用带有注释的spring mvc,请参见以下代码段
@RequestMapping(value = "/configuration/", method = RequestMethod.GET)
public MyModel viewConfiguration() {
我在JSP中访问“ MyModel”类时遇到的问题。
在不使用ModelAndView对象的情况下该如何做?
最佳答案
这种简化的语法意味着MyModel
成为名为myModel
的模型属性(即,首字母大写的类名)。
从URL推断视图名称。
也可以看看:
15.3.2.3 Supported handler method arguments and return types
15.10.3 The View - RequestToViewNameTranslator