anchor.diff:  	<mvc:resources mapping="/resources/**" location="/public-resources/" cache-period="31556926"/>
   ----
   
  +For more details, see <<mvc-caching-static-resources, HTTP caching support for static resources>>.
  +
  +
   The `mapping` attribute must be an Ant pattern that can be used by
   `SimpleUrlHandlerMapping`, and the `location` attribute must specify one or more valid
   resource directory locations. Multiple resource locations may be specified using a
  
positive.code: `WebBindingInitializer`. See the <<mvc-ann-controller-advice>> section for more details.
  
  
  [[mvc-ann-lastmodified]]
  ==== Support for the Last-Modified Response Header To Facilitate Content Caching
  An `@RequestMapping` method may wish to support `'Last-Modified'` HTTP requests, as
  defined in the contract for the Servlet API's `getLastModified` method, to facilitate
  content caching. This involves calculating a lastModified `long` value for a given
  request, comparing it against the `'If-Modified-Since'` request header value, and
  potentially returning a response with status code 304 (Not Modified). An annotated
  controller method can achieve that as follows:
  
  [source,java,indent=0]
  [subs="verbatim,quotes"]
  ----
  	@RequestMapping
  	public String myHandleMethod(WebRequest webRequest, Model model) {
  
  		long lastModified = // 1. application-specific calculation
  
  		if (request.checkNotModified(lastModified)) {
  			// 2. shortcut exit - no further processing necessary
  			return null;
  		}
  
  		// 3. or otherwise further request processing, actually preparing content
  		model.addAttribute(...);
  		return "myViewName";
  	}
  ----
  
  There are two key elements to note: calling `request.checkNotModified(lastModified)` and
  returning `null`. The former sets the response status to 304 before it returns `true`.
  The latter, in combination with the former, causes Spring MVC to do no further
  processing of the request.
  
  [[mvc-ann-controller-advice]]
  ==== Advising controllers with the `@ControllerAdvice` annotation
  The `@ControllerAdvice` annotation is a component annotation allowing implementation
  
negative.code: 	</filter-mapping>
  ----
  
  Or in Servlet 3.0+ environments,
  
  [source,java,indent=0]
  [subs="verbatim,quotes"]
  ----
  	public class MyWebAppInitializer extends AbstractDispatcherServletInitializer {
  
  		// ...
  
  		@Override
  		protected Filter[] getServletFilters() {
  			return new Filter[] { new ShallowEtagHeaderFilter() };
  		}
  
  	}
  ----
  
  See <<mvc-container-config>> for more details.
  
  
  
  