我刚刚回答了以下有关此已发布问题的问题.
I have just answered the below question which revolves around this posted question.
spring mvc InternalResourceViewResolver没有前缀
有人可以说出课程之间的区别
Can someone out there tell the difference between the classes
org/springframework/web/servlet/ModelAndView 和 org/springframework/web/portlet/ModelAndView
我都看到了几乎相似的API文档
I see almost similar API docs for both
docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/ModelAndView.html
和
docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/portlet/ModelAndView.html
都具有构造函数
ModelAndView(String viewName) Convenient constructor when there is no model data to expose.而后者在解析视图时不起作用?
and yet the latter doesn't work in resolving the view?
推荐答案忽略这两个是针对两个完全不同的环境的,不同之处在于 org.springframework.web.servlet.ModelAndView 是支持处理程序方法返回类型:
Ignoring that these two are meant for two completely different environments, the difference is that org.springframework.web.servlet.ModelAndView is a supported handler method return type:
- 一个 ModelAndView 对象,该模型隐含了命令对象和 @ModelAttribute 注释的参考数据访问器方法的结果.
- A ModelAndView object, with the model implicitly enriched with command objects and the results of @ModelAttribute annotated reference data accessor methods.
- Spring MVC既不是BindingResult也不是普通目标
- HandlerMethodReturnValueHandler 工作?
这意味着Spring具有 HandlerMethodReturnValueHandler 实现( ModelAndViewMethodReturnValueHandler ),它将收到类型为 ModelAndView 并对其进行处理.
That means that Spring has a HandlerMethodReturnValueHandler implementation (ModelAndViewMethodReturnValueHandler) that will receive the return value of type ModelAndView and process it.
它没有默认注册的 org.springframework.web.portlet.ModelAndView 的实现.
It does not have such a implementation for org.springframework.web.portlet.ModelAndView registered by default.
更多:
更多推荐
org/springframework/web/servlet/ModelAndView类与org/springframework/web/portlet/Mo
发布评论