Polishing
This commit is contained in:
@@ -81,7 +81,6 @@ import org.springframework.web.servlet.support.RequestContextUtils;
|
||||
* @author Arjen Poutsma
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
*
|
||||
* @deprecated as of Spring 3.2, in favor of
|
||||
* {@link org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver ExceptionHandlerExceptionResolver}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -78,8 +78,7 @@ import org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMappin
|
||||
* @since 2.5
|
||||
* @see RequestMapping
|
||||
* @see AnnotationMethodHandlerAdapter
|
||||
*
|
||||
* @deprecated in Spring 3.2 in favor of
|
||||
* @deprecated as of Spring 3.2, in favor of
|
||||
* {@link org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping RequestMappingHandlerMapping}
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,39 +23,36 @@ import org.springframework.web.context.request.NativeWebRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* SPI for resolving custom return values from a specific handler method. Typically implemented to detect special return
|
||||
* types, resolving well-known result values for them.
|
||||
* SPI for resolving custom return values from a specific handler method.
|
||||
* Typically implemented to detect special return types, resolving
|
||||
* well-known result values for them.
|
||||
*
|
||||
* <p>A typical implementation could look like as follows:
|
||||
*
|
||||
* <pre class="code">
|
||||
* public class MyModelAndViewResolver implements ModelAndViewResolver {
|
||||
*
|
||||
* public ModelAndView resolveModelAndView(Method handlerMethod,
|
||||
* Class handlerType,
|
||||
* Object returnValue,
|
||||
* ExtendedModelMap implicitModel,
|
||||
* NativeWebRequest webRequest) {
|
||||
* if (returnValue instanceof MySpecialRetVal.class)) {
|
||||
* return new MySpecialRetVal(returnValue);
|
||||
* public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType,
|
||||
* Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) {
|
||||
* if (returnValue instanceof MySpecialRetVal.class)) {
|
||||
* return new MySpecialRetVal(returnValue);
|
||||
* }
|
||||
* return UNRESOLVED;
|
||||
* }
|
||||
* return UNRESOLVED;
|
||||
* }
|
||||
* }</pre>
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers
|
||||
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface ModelAndViewResolver {
|
||||
|
||||
/** Marker to be returned when the resolver does not know how to handle the given method parameter. */
|
||||
/**
|
||||
* Marker to be returned when the resolver does not know how to handle the given method parameter.
|
||||
*/
|
||||
ModelAndView UNRESOLVED = new ModelAndView();
|
||||
|
||||
ModelAndView resolveModelAndView(Method handlerMethod,
|
||||
Class<?> handlerType,
|
||||
Object returnValue,
|
||||
ExtendedModelMap implicitModel,
|
||||
NativeWebRequest webRequest);
|
||||
|
||||
ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue,
|
||||
ExtendedModelMap implicitModel, NativeWebRequest webRequest);
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes
|
||||
this.messageSource = messageSource;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler, Exception ex) {
|
||||
@@ -76,12 +77,10 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes
|
||||
|
||||
/**
|
||||
* Template method that handles {@link ResponseStatus @ResponseStatus} annotation.
|
||||
*
|
||||
* <p>Default implementation send a response error using
|
||||
* <p>The default implementation sends a response error using
|
||||
* {@link HttpServletResponse#sendError(int)} or
|
||||
* {@link HttpServletResponse#sendError(int, String)} if the annotation has a
|
||||
* {@linkplain ResponseStatus#reason() reason} and then returns an empty ModelAndView.
|
||||
*
|
||||
* @param responseStatus the annotation
|
||||
* @param request current HTTP request
|
||||
* @param response current HTTP response
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,8 +31,7 @@ import org.springframework.web.util.WebUtils;
|
||||
* @author Juergen Hoeller
|
||||
* @author Arjen Poutsma
|
||||
* @since 2.5.2
|
||||
*
|
||||
* @deprecated in 3.2 together with {@link DefaultAnnotationHandlerMapping},
|
||||
* @deprecated as of 3.2, together with {@link DefaultAnnotationHandlerMapping},
|
||||
* {@link AnnotationMethodHandlerAdapter}, and {@link AnnotationMethodHandlerExceptionResolver}.
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
Reference in New Issue
Block a user