ModelAndViewResolver declares handlerType as Class<?>
Issue: SPR-7860
This commit is contained in:
@@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SPI for resolving custom return values from a specific handler method. Typically implemented to detect special return
|
* SPI for resolving custom return values from a specific handler method.
|
||||||
* types, resolving well-known result values for them.
|
* Typically implemented to detect special return types, resolving
|
||||||
|
* well-known result values for them.
|
||||||
*
|
*
|
||||||
* <p>A typical implementation could look like as follows:
|
* <p>A typical implementation could look like as follows:
|
||||||
*
|
*
|
||||||
* <pre class="code">
|
* <pre class="code">
|
||||||
* public class MyModelAndViewResolver implements ModelAndViewResolver {
|
* public class MyModelAndViewResolver implements ModelAndViewResolver {
|
||||||
*
|
*
|
||||||
* public ModelAndView resolveModelAndView(Method handlerMethod,
|
* public ModelAndView resolveModelAndView(Method handlerMethod, Class handlerType,
|
||||||
* Class handlerType,
|
* Object returnValue, ExtendedModelMap implicitModel, NativeWebRequest webRequest) {
|
||||||
* Object returnValue,
|
* if (returnValue instanceof MySpecialRetVal.class)) {
|
||||||
* ExtendedModelMap implicitModel,
|
* return new MySpecialRetVal(returnValue);
|
||||||
* NativeWebRequest webRequest) {
|
* }
|
||||||
* if (returnValue instanceof MySpecialRetVal.class)) {
|
* return UNRESOLVED;
|
||||||
* return new MySpecialRetVal(returnValue);
|
|
||||||
* }
|
* }
|
||||||
* return UNRESOLVED;
|
|
||||||
* }
|
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*
|
*
|
||||||
* @author Arjen Poutsma
|
* @author Arjen Poutsma
|
||||||
* @see org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers
|
|
||||||
* @see org.springframework.web.portlet.mvc.annotation.AnnotationMethodHandlerAdapter#setCustomModelAndViewResolvers
|
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public interface ModelAndViewResolver {
|
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 UNRESOLVED = new ModelAndView();
|
||||||
|
|
||||||
ModelAndView resolveModelAndView(Method handlerMethod,
|
|
||||||
Class handlerType,
|
ModelAndView resolveModelAndView(Method handlerMethod, Class<?> handlerType, Object returnValue,
|
||||||
Object returnValue,
|
ExtendedModelMap implicitModel, NativeWebRequest webRequest);
|
||||||
ExtendedModelMap implicitModel,
|
|
||||||
NativeWebRequest webRequest);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user