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 CookieValue

Annotation which indicates that a method parameter should be bound to an HTTP cookie. Supported for annotated handler methods in Servlet and Portlet environments.

The method parameter may be declared as type javax.servlet.http.Cookie or as cookie value type (String, int, etc). @author Juergen Hoeller @since 3.0 @see RequestMapping @see RequestParam @see RequestHeader @see org.springframework.web.bind.annotation.RequestMapping @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter RequestMappingHandlerAdapter @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter


Class ExceptionHandler

Annotation for handling exceptions in specific handler classes and/or handler methods. Provides consistent style between Servlet and Portlet environments, with the semantics adapting to the concrete environment.

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:

The following return types are supported for handler methods:

In Servlet environments, you can combine the {@code ExceptionHandler} annotation with @ResponseStatus, to define the response status for the HTTP response.

Note: In Portlet environments, {@code ExceptionHandler} annotated methods will only be called during the render and resource phases - just like org.springframework.web.portlet.HandlerExceptionResolver beans would. Exceptions carried over from the action and event phases will be invoked during the render phase as well, with exception handler methods having to be present on the controller class that defines the applicable render method. @author Arjen Poutsma @author Juergen Hoeller @since 3.0 @see org.springframework.web.context.request.WebRequest @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver


Class PathVariable

Annotation which indicates that a method parameter should be bound to a URI template variable. Supported for RequestMapping annotated handler methods in Servlet environments. @author Arjen Poutsma @see RequestMapping @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter RequestMappingHandlerAdapter @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter @since 3.0

Class RequestBody

Annotation indicating a method parameter should be bound to the body of the web request. The body of the request is passed through an HttpMessageConverter to resolve the the method argument depending on the content type of the request. Optionally, automaticautomatic validation can be applied by annotating the argument with {@code @Valid}.

Supported for annotated handler methods in Servlet environments. @author Arjen Poutsma @see RequestHeader @see ResponseBody @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter RequestMappingHandlerAdapter @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter @since 3.0


Class RequestHeader

Annotation which indicates that a method parameter should be bound to a web request header. Supported for annotated handler methods in Servlet and Portlet environments. @author Juergen Hoeller @since 3.0 @see RequestMapping @see RequestParam @see CookieValue @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter RequestMappingHandlerAdapter @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter

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: Method-level mappings are only allowed to narrowThe the mapping expressed at the class levelset of features supported for Servlets is (ifa any).superset Inof the Servlet case,set an HTTP path needsof features supported for to Portlets. uniquely map onto one specific handler beanThe places where this applies are marked (notwith spread acrossthe label multiple"Servlet-only" handlerin beans); this thesource remainingfile. mapping parameters and conditionsFor Servlet environments there are effectivelysome assertionsfurther only. Indistinctions the Portletdepending case,on a portlet mode in combinationwhether an application is configured with specific{@literal parameter"@MVC conditions 3.0"} needsor to{@literal uniquely"@MVC map3.1"} ontosupport oneclasses. specific handlerThe places bean,where with all conditions evaluated forthis applies are marked with mapping{@literal "@MVC purposes3.1-only"} It is stronglyin this source recommendedfile. toFor co-locatemore related handler methods intodetails see the note on the same bean and therefore keep the mappingsnew support classes added in Spring MVC simple3.1 and intuitivefurther 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 a an correspondingan appropriate HandlerMapping (for type level annotations) and/or -HandlerAdapter (for method level annotations) is present inpair the dispatcheris configured. This is the case by default in both both the DispatcherServlet and the DispatcherPortlet. However, if you are defining custom HandlerMappings or HandlerAdapters, then you need to makeadd sureDefaultAnnotationHandlerMapping thatand a AnnotationMethodHandlerAdapter correspondingto customyour configuration..

NOTE: Spring 3.1 introduced a new set of support classes for RequestMappingHandlerMethodMapping@RequestMapping and/ormethods in Servlet environments called RequestMappingHandlerMethodAdapterRequestMappingHandlerMapping isand RequestMappingHandlerAdapter. defined as well - provided that you intendThey 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 (@RequestMappingEnableWebMvc) 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.RequestMappingHandlerMethodMapping @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter RequestMappingHandlerAdapter @see org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter


Class RequestMethod

Java 5 enumeration of HTTP request methods. Intended for use with the RequestMapping.method() attribute of the RequestMapping annotation.

Note that, by default, org.springframework.web.servlet.DispatcherServlet supports GET, HEAD, POST, PUT, PATCH and DELETE only. DispatcherServlet will process TRACE and OPTIONS with the default HttpServlet behavior unless explicitly told to dispatch those request types as well: Check out the "dispatchOptionsRequest" and "dispatchTraceRequest" properties, switching them to "true" if necessary. @author Juergen Hoeller @since 2.5 @see RequestMapping @see org.springframework.web.servlet.DispatcherServlet#setDispatchOptionsRequest @see org.springframework.web.servlet.DispatcherServlet#setDispatchTraceRequest


Class RequestParam

Annotation which indicates that a method parameter should be bound to a web request parameter. Supported for annotated handler methods in Servlet and Portlet environments.

If the method parameter type is Map and a request parameter name is specified, then the request parameter value is converted to a Map assuming an appropriate conversion strategy is available.

If the method parameter is Map<String, String> or MultiValueMap<String, String> and a parameter name is not specified, then the map parameter is populated with all request parameter names and values. @author Arjen Poutsma @author Juergen Hoeller @since 2.5 @see RequestMapping @see RequestHeader @see CookieValue @see org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMethodAdapter RequestMappingHandlerAdapter @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter