Generated by
JDiff

org.springframework.web.bind.annotation Documentation Differences

This file contains all the changes in documentation in the package org.springframework.web.bind.annotation as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class ModelAttribute

Annotation that binds a method parameter or method return value to a named model attribute, exposed to a web view. Supported for controller classes with @RequestMapping annotated handler classesmethods.

Can be used to expose command objects to a web view, using specific attribute names, through annotating corresponding parameters of aan @RequestMapping annotated handler method).

Can also be used to expose reference data to a web view through annotating accessor methods in a controller class which is based onwith @RequestMapping annotated handler methods, with. such accessorSuch accessor methods are allowed to have any arguments that @RequestMapping supports for handler methods support, returning the model attribute value to expose.

Note however that reference data and all other model content is not available to web views when request processing results in an {@code Exception} since the exception could be raised at any time making the content of the model unreliable. For this reason @ExceptionHandler methods do not provide access to a Model argument. @author Juergen Hoeller @since 2.5


Class RequestMapping

Annotation for mapping web requests onto specific handler classes and/or handler methods. Provides a consistent style between Servlet and Portlet environments, with the semantics adapting to the concrete environment.

NOTE: The set of features supported for Servlets is a superset of the set of features supported for Portlets. The places where this applies are marked with the label "Servlet-only" in this source file. For Servlet environments there are some further distinctions depending on whether an application is configured with {@literal "@MVC 3.0"} or {@literal "@MVC 3.1"} support classes. The places where this applies are marked with {@literal "@MVC 3.1-only"} in this source file. For more details see the note on the new support classes added in Spring MVC 3.1 further below.

Handler methods which are annotated with this annotation are allowed to have very flexible signatures. They may have arguments of the following types, in arbitrary order (except for validation results, which need to follow right after the corresponding command object, if desired):

The following return types are supported for handler methods:

NOTE: @RequestMapping will only be processed if an an appropriate HandlerMapping-HandlerAdapter pair is configured. This is the case by default in both the DispatcherServlet and the DispatcherPortlet. However, if you are defining custom HandlerMappings or HandlerAdapters, then you need to add DefaultAnnotationHandlerMapping and AnnotationMethodHandlerAdapter to your configuration..

NOTE: Spring 3.1 introduced a new set of support classes for @RequestMapping methods in Servlet environments called RequestMappingHandlerMapping and RequestMappingHandlerAdapter. They are recommended for use and even required to take advantage of new features in Spring MVC 3.1 (search {@literal "@MVC 3.1-only"} in this source file) and going forward. The new support classes are enabled by default from the MVC namespace and with use of the MVC Java config (@EnableWebMvc) but must be configured explicitly if using neither.

NOTE: When using controller interfaces (e.g. for AOP proxying), make sure to consistently put all your mapping annotations - such as @RequestMapping and @SessionAttributes - on the controller interface rather than on the implementation class. @author Juergen Hoeller @author Arjen Poutsma @author Sam Brannen @since 2.5 @see RequestParam @see ModelAttribute @see SessionAttributes @see InitBinder @see org.springframework.web.context.request.WebRequest @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter @see org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter