Browse Source

Polishing

pull/642/head
Juergen Hoeller 11 years ago
parent
commit
b91cab1fde
  1. 6
      spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java
  2. 12
      spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java
  3. 4
      spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java
  4. 28
      spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java
  5. 21
      spring-messaging/src/main/java/org/springframework/messaging/simp/config/TaskExecutorRegistration.java
  6. 25
      spring-web/src/main/java/org/springframework/web/method/annotation/AbstractWebArgumentResolverAdapter.java
  7. 8
      spring-web/src/main/java/org/springframework/web/method/annotation/ErrorsMethodArgumentResolver.java
  8. 15
      spring-web/src/main/java/org/springframework/web/method/annotation/MapMethodProcessor.java
  9. 15
      spring-web/src/main/java/org/springframework/web/method/annotation/ModelMethodProcessor.java
  10. 11
      spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMapMethodArgumentResolver.java
  11. 26
      spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMapMethodArgumentResolver.java
  12. 8
      spring-web/src/main/java/org/springframework/web/method/annotation/SessionStatusMethodArgumentResolver.java
  13. 10
      spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java
  14. 21
      spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolverComposite.java
  15. 8
      spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java
  16. 23
      spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerComposite.java
  17. 12
      spring-web/src/main/java/org/springframework/web/method/support/ModelAndViewContainer.java
  18. 11
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AsyncTaskMethodReturnValueHandler.java
  19. 10
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/CallableMethodReturnValueHandler.java
  20. 12
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultMethodReturnValueHandler.java
  21. 8
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewMethodReturnValueHandler.java
  22. 14
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandler.java
  23. 8
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/PathVariableMapMethodArgumentResolver.java
  24. 18
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RedirectAttributesMethodArgumentResolver.java
  25. 25
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java
  26. 31
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletModelAttributeMethodProcessor.java
  27. 11
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolver.java
  28. 16
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletResponseMethodArgumentResolver.java
  29. 8
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/UriComponentsBuilderMethodArgumentResolver.java
  30. 8
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ViewMethodReturnValueHandler.java
  31. 8
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ViewNameMethodReturnValueHandler.java
  32. 5
      spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java

6
spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -213,7 +213,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
Binding binding = new Binding() { Binding binding = new Binding() {
@Override @Override
public void setVariable(String name, Object value) { public void setVariable(String name, Object value) {
if (currentBeanDefinition !=null) { if (currentBeanDefinition != null) {
applyPropertyToBeanDefinition(name, value); applyPropertyToBeanDefinition(name, value);
} }
else { else {
@ -410,7 +410,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
} }
dp.apply(); dp.apply();
} }
deferredProperties.clear(); this.deferredProperties.clear();
} }
/** /**

12
spring-context/src/main/java/org/springframework/context/annotation/ClassPathBeanDefinitionScanner.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -103,8 +103,7 @@ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateCo
* {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Component @Component},
* {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Repository @Repository},
* {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Service @Service}, and
* {@link org.springframework.stereotype.Controller @Controller} stereotype * {@link org.springframework.stereotype.Controller @Controller} stereotype annotations
* annotations.
* @see #setResourceLoader * @see #setResourceLoader
* @see #setEnvironment * @see #setEnvironment
*/ */
@ -124,13 +123,12 @@ public class ClassPathBeanDefinitionScanner extends ClassPathScanningCandidateCo
* @param registry the {@code BeanFactory} to load bean definitions into, in the form * @param registry the {@code BeanFactory} to load bean definitions into, in the form
* of a {@code BeanDefinitionRegistry} * of a {@code BeanDefinitionRegistry}
* @param useDefaultFilters whether to include the default filters for the * @param useDefaultFilters whether to include the default filters for the
* @param environment the Spring {@link Environment} to use when evaluating bean
* definition profile metadata.
* {@link org.springframework.stereotype.Component @Component}, * {@link org.springframework.stereotype.Component @Component},
* {@link org.springframework.stereotype.Repository @Repository}, * {@link org.springframework.stereotype.Repository @Repository},
* {@link org.springframework.stereotype.Service @Service}, and * {@link org.springframework.stereotype.Service @Service}, and
* {@link org.springframework.stereotype.Controller @Controller} stereotype * {@link org.springframework.stereotype.Controller @Controller} stereotype annotations
* annotations. * @param environment the Spring {@link Environment} to use when evaluating bean
* definition profile metadata
* @since 3.1 * @since 3.1
* @see #setResourceLoader * @see #setResourceLoader
*/ */

4
spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java

@ -115,6 +115,7 @@ public class ClassPathScanningCandidateComponentProvider implements EnvironmentC
if (useDefaultFilters) { if (useDefaultFilters) {
registerDefaultFilters(); registerDefaultFilters();
} }
Assert.notNull(environment, "Environment must not be null");
this.environment = environment; this.environment = environment;
} }
@ -161,10 +162,11 @@ public class ClassPathScanningCandidateComponentProvider implements EnvironmentC
/** /**
* Set the Environment to use when resolving placeholders and evaluating * Set the Environment to use when resolving placeholders and evaluating
* {@link Conditional @Conditional}-annotated component classes. * {@link Conditional @Conditional}-annotated component classes.
* <p>The default is a {@link StandardEnvironment} * <p>The default is a {@link StandardEnvironment}.
* @param environment the Environment to use * @param environment the Environment to use
*/ */
public void setEnvironment(Environment environment) { public void setEnvironment(Environment environment) {
Assert.notNull(environment, "Environment must not be null");
this.environment = environment; this.environment = environment;
this.conditionEvaluator = null; this.conditionEvaluator = null;
} }

28
spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -78,10 +78,10 @@ public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport
private int keepAliveSeconds = 60; private int keepAliveSeconds = 60;
private boolean allowCoreThreadTimeOut = false;
private int queueCapacity = Integer.MAX_VALUE; private int queueCapacity = Integer.MAX_VALUE;
private boolean allowCoreThreadTimeOut = false;
private ThreadPoolExecutor threadPoolExecutor; private ThreadPoolExecutor threadPoolExecutor;
@ -154,17 +154,6 @@ public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport
} }
} }
/**
* Specify whether to allow core threads to time out. This enables dynamic
* growing and shrinking even in combination with a non-zero queue (since
* the max pool size will only grow once the queue is full).
* <p>Default is "false".
* @see java.util.concurrent.ThreadPoolExecutor#allowCoreThreadTimeOut(boolean)
*/
public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
this.allowCoreThreadTimeOut = allowCoreThreadTimeOut;
}
/** /**
* Set the capacity for the ThreadPoolExecutor's BlockingQueue. * Set the capacity for the ThreadPoolExecutor's BlockingQueue.
* Default is {@code Integer.MAX_VALUE}. * Default is {@code Integer.MAX_VALUE}.
@ -177,6 +166,17 @@ public class ThreadPoolTaskExecutor extends ExecutorConfigurationSupport
this.queueCapacity = queueCapacity; this.queueCapacity = queueCapacity;
} }
/**
* Specify whether to allow core threads to time out. This enables dynamic
* growing and shrinking even in combination with a non-zero queue (since
* the max pool size will only grow once the queue is full).
* <p>Default is "false".
* @see java.util.concurrent.ThreadPoolExecutor#allowCoreThreadTimeOut(boolean)
*/
public void setAllowCoreThreadTimeOut(boolean allowCoreThreadTimeOut) {
this.allowCoreThreadTimeOut = allowCoreThreadTimeOut;
}
@Override @Override
protected ExecutorService initializeExecutor( protected ExecutorService initializeExecutor(

21
spring-messaging/src/main/java/org/springframework/messaging/simp/config/TaskExecutorRegistration.java

@ -18,7 +18,6 @@ package org.springframework.messaging.simp.config;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
/** /**
* A registration class for customizing the properties of {@link ThreadPoolTaskExecutor}. * A registration class for customizing the properties of {@link ThreadPoolTaskExecutor}.
* *
@ -38,13 +37,11 @@ public class TaskExecutorRegistration {
/** /**
* Set the core pool size of the ThreadPoolExecutor. * Set the core pool size of the ThreadPoolExecutor.
* * <p><strong>NOTE:</strong> The core pool size is effectively the max pool size
* <p><strong>NOTE:</strong> the core pool size is effectively the max pool size
* when an unbounded {@link #queueCapacity(int) queueCapacity} is configured * when an unbounded {@link #queueCapacity(int) queueCapacity} is configured
* (the default). This is essentially the "Unbounded queues" strategy as explained * (the default). This is essentially the "Unbounded queues" strategy as explained
* in {@link java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor}. When * in {@link java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor}. When
* this strategy is used, the {@link #maxPoolSize(int) maxPoolSize} is ignored. * this strategy is used, the {@link #maxPoolSize(int) maxPoolSize} is ignored.
*
* <p>By default this is set to twice the value of * <p>By default this is set to twice the value of
* {@link Runtime#availableProcessors()}. In an an application where tasks do not * {@link Runtime#availableProcessors()}. In an an application where tasks do not
* block frequently, the number should be closer to or equal to the number of * block frequently, the number should be closer to or equal to the number of
@ -57,13 +54,11 @@ public class TaskExecutorRegistration {
/** /**
* Set the max pool size of the ThreadPoolExecutor. * Set the max pool size of the ThreadPoolExecutor.
* * <p><strong>NOTE:</strong> When an unbounded
* <p><strong>NOTE:</strong> when an unbounded
* {@link #queueCapacity(int) queueCapacity} is configured (the default), the * {@link #queueCapacity(int) queueCapacity} is configured (the default), the
* max pool size is effectively ignored. See the "Unbounded queues" strategy * max pool size is effectively ignored. See the "Unbounded queues" strategy
* in {@link java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor} for * in {@link java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor} for
* more details. * more details.
*
* <p>By default this is set to {@code Integer.MAX_VALUE}. * <p>By default this is set to {@code Integer.MAX_VALUE}.
*/ */
public TaskExecutorRegistration maxPoolSize(int maxPoolSize) { public TaskExecutorRegistration maxPoolSize(int maxPoolSize) {
@ -73,14 +68,11 @@ public class TaskExecutorRegistration {
/** /**
* Set the queue capacity for the ThreadPoolExecutor. * Set the queue capacity for the ThreadPoolExecutor.
* * <p><strong>NOTE:</strong> when an unbounded {@code queueCapacity} is configured
* <p><strong>NOTE:</strong> when an unbounded * (the default), the core pool size is effectively the max pool size. This is
* {@link #queueCapacity(int) queueCapacity} is configured (the default) the * essentially the "Unbounded queues" strategy as explained in
* core pool size is effectively the max pool size. This is essentially the
* "Unbounded queues" strategy as explained in
* {@link java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor}. When * {@link java.util.concurrent.ThreadPoolExecutor ThreadPoolExecutor}. When
* this strategy is used, the {@link #maxPoolSize(int) maxPoolSize} is ignored. * this strategy is used, the {@link #maxPoolSize(int) maxPoolSize} is ignored.
*
* <p>By default this is set to {@code Integer.MAX_VALUE}. * <p>By default this is set to {@code Integer.MAX_VALUE}.
*/ */
public TaskExecutorRegistration queueCapacity(int queueCapacity) { public TaskExecutorRegistration queueCapacity(int queueCapacity) {
@ -92,8 +84,7 @@ public class TaskExecutorRegistration {
* Set the time limit for which threads may remain idle before being terminated. * Set the time limit for which threads may remain idle before being terminated.
* If there are more than the core number of threads currently in the pool, * If there are more than the core number of threads currently in the pool,
* after waiting this amount of time without processing a task, excess threads * after waiting this amount of time without processing a task, excess threads
* will be terminated. This overrides any value set in the constructor. * will be terminated. This overrides any value set in the constructor.
*
* <p>By default this is set to 60. * <p>By default this is set to 60.
*/ */
public TaskExecutorRegistration keepAliveSeconds(int keepAliveSeconds) { public TaskExecutorRegistration keepAliveSeconds(int keepAliveSeconds) {

25
spring-web/src/main/java/org/springframework/web/method/annotation/AbstractWebArgumentResolverAdapter.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -18,6 +18,7 @@ package org.springframework.web.method.annotation;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.ClassUtils; import org.springframework.util.ClassUtils;
@ -47,10 +48,11 @@ import org.springframework.web.method.support.ModelAndViewContainer;
*/ */
public abstract class AbstractWebArgumentResolverAdapter implements HandlerMethodArgumentResolver { public abstract class AbstractWebArgumentResolverAdapter implements HandlerMethodArgumentResolver {
private final Log logger = LogFactory.getLog(this.getClass()); private final Log logger = LogFactory.getLog(getClass());
private final WebArgumentResolver adaptee; private final WebArgumentResolver adaptee;
/** /**
* Create a new instance. * Create a new instance.
*/ */
@ -59,6 +61,7 @@ public abstract class AbstractWebArgumentResolverAdapter implements HandlerMetho
this.adaptee = adaptee; this.adaptee = adaptee;
} }
/** /**
* Actually resolve the value and check the resolved value is not * Actually resolve the value and check the resolved value is not
* {@link WebArgumentResolver#UNRESOLVED} absorbing _any_ exceptions. * {@link WebArgumentResolver#UNRESOLVED} absorbing _any_ exceptions.
@ -82,21 +85,14 @@ public abstract class AbstractWebArgumentResolverAdapter implements HandlerMetho
} }
} }
/**
* Required for access to NativeWebRequest in {@link #supportsParameter}.
*/
protected abstract NativeWebRequest getWebRequest();
/** /**
* Delegate to the {@link WebArgumentResolver} instance. * Delegate to the {@link WebArgumentResolver} instance.
* @exception IllegalStateException if the resolved value is not assignable * @exception IllegalStateException if the resolved value is not assignable
* to the method parameter. * to the method parameter.
*/ */
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
Class<?> paramType = parameter.getParameterType(); Class<?> paramType = parameter.getParameterType();
Object result = this.adaptee.resolveArgument(parameter, webRequest); Object result = this.adaptee.resolveArgument(parameter, webRequest);
@ -108,4 +104,11 @@ public abstract class AbstractWebArgumentResolverAdapter implements HandlerMetho
} }
return result; return result;
} }
/**
* Required for access to NativeWebRequest in {@link #supportsParameter}.
*/
protected abstract NativeWebRequest getWebRequest();
} }

8
spring-web/src/main/java/org/springframework/web/method/annotation/ErrorsMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -47,10 +47,8 @@ public class ErrorsMethodArgumentResolver implements HandlerMethodArgumentResolv
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
ModelMap model = mavContainer.getModel(); ModelMap model = mavContainer.getModel();
if (model.size() > 0) { if (model.size() > 0) {

15
spring-web/src/main/java/org/springframework/web/method/annotation/MapMethodProcessor.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -44,10 +44,8 @@ public class MapMethodProcessor implements HandlerMethodArgumentResolver, Handle
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
return mavContainer.getModel(); return mavContainer.getModel();
} }
@ -59,10 +57,8 @@ public class MapMethodProcessor implements HandlerMethodArgumentResolver, Handle
@Override @Override
@SuppressWarnings({ "unchecked", "rawtypes" }) @SuppressWarnings({ "unchecked", "rawtypes" })
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest webRequest)
throws Exception {
if (returnValue == null) { if (returnValue == null) {
return; return;
@ -76,4 +72,5 @@ public class MapMethodProcessor implements HandlerMethodArgumentResolver, Handle
returnType.getParameterType().getName() + " in method: " + returnType.getMethod()); returnType.getParameterType().getName() + " in method: " + returnType.getMethod());
} }
} }
} }

15
spring-web/src/main/java/org/springframework/web/method/annotation/ModelMethodProcessor.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -43,10 +43,8 @@ public class ModelMethodProcessor implements HandlerMethodArgumentResolver, Hand
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
return mavContainer.getModel(); return mavContainer.getModel();
} }
@ -57,10 +55,8 @@ public class ModelMethodProcessor implements HandlerMethodArgumentResolver, Hand
} }
@Override @Override
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest webRequest)
throws Exception {
if (returnValue == null) { if (returnValue == null) {
return; return;
@ -74,4 +70,5 @@ public class ModelMethodProcessor implements HandlerMethodArgumentResolver, Hand
returnType.getParameterType().getName() + " in method: " + returnType.getMethod()); returnType.getParameterType().getName() + " in method: " + returnType.getMethod());
} }
} }
} }

11
spring-web/src/main/java/org/springframework/web/method/annotation/RequestHeaderMapMethodArgumentResolver.java

@ -47,18 +47,15 @@ public class RequestHeaderMapMethodArgumentResolver implements HandlerMethodArgu
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
return parameter.hasParameterAnnotation(RequestHeader.class) && return (parameter.hasParameterAnnotation(RequestHeader.class) &&
Map.class.isAssignableFrom(parameter.getParameterType()); Map.class.isAssignableFrom(parameter.getParameterType()));
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
Class<?> paramType = parameter.getParameterType(); Class<?> paramType = parameter.getParameterType();
if (MultiValueMap.class.isAssignableFrom(paramType)) { if (MultiValueMap.class.isAssignableFrom(paramType)) {
MultiValueMap<String, String> result; MultiValueMap<String, String> result;
if (HttpHeaders.class.isAssignableFrom(paramType)) { if (HttpHeaders.class.isAssignableFrom(paramType)) {

26
spring-web/src/main/java/org/springframework/web/method/annotation/RequestParamMapMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -30,13 +30,15 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer; import org.springframework.web.method.support.ModelAndViewContainer;
/** /**
* Resolves {@link Map} method arguments annotated with an @{@link RequestParam} where the annotation does not * Resolves {@link Map} method arguments annotated with an @{@link RequestParam}
* specify a request parameter name. See {@link RequestParamMethodArgumentResolver} for resolving {@link Map} * where the annotation does not specify a request parameter name.
* See {@link RequestParamMethodArgumentResolver} for resolving {@link Map}
* method arguments with a request parameter name. * method arguments with a request parameter name.
* *
* <p>The created {@link Map} contains all request parameter name/value pairs. If the method parameter type * <p>The created {@link Map} contains all request parameter name/value pairs.
* is {@link MultiValueMap} instead, the created map contains all request parameters and all there values for * If the method parameter type is {@link MultiValueMap} instead, the created
* cases where request parameters have multiple values. * map contains all request parameters and all there values for cases where
* request parameters have multiple values.
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
@ -47,20 +49,18 @@ public class RequestParamMapMethodArgumentResolver implements HandlerMethodArgum
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
RequestParam requestParamAnnot = parameter.getParameterAnnotation(RequestParam.class); RequestParam ann = parameter.getParameterAnnotation(RequestParam.class);
if (requestParamAnnot != null) { if (ann != null) {
if (Map.class.isAssignableFrom(parameter.getParameterType())) { if (Map.class.isAssignableFrom(parameter.getParameterType())) {
return !StringUtils.hasText(requestParamAnnot.value()); return !StringUtils.hasText(ann.value());
} }
} }
return false; return false;
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
Class<?> paramType = parameter.getParameterType(); Class<?> paramType = parameter.getParameterType();

8
spring-web/src/main/java/org/springframework/web/method/annotation/SessionStatusMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -38,10 +38,8 @@ public class SessionStatusMethodArgumentResolver implements HandlerMethodArgumen
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
return mavContainer.getSessionStatus(); return mavContainer.getSessionStatus();
} }

10
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -27,6 +27,7 @@ import org.springframework.web.context.request.NativeWebRequest;
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @since 3.1 * @since 3.1
* @see HandlerMethodReturnValueHandler
*/ */
public interface HandlerMethodArgumentResolver { public interface HandlerMethodArgumentResolver {
@ -46,13 +47,12 @@ public interface HandlerMethodArgumentResolver {
* a {@link WebDataBinder} instance when needed for data binding and * a {@link WebDataBinder} instance when needed for data binding and
* type conversion purposes. * type conversion purposes.
* @param parameter the method parameter to resolve. This parameter must * @param parameter the method parameter to resolve. This parameter must
* have previously been passed to * have previously been passed to {@link #supportsParameter} which must
* {@link #supportsParameter(org.springframework.core.MethodParameter)} * have returned {@code true}.
* and it must have returned {@code true}
* @param mavContainer the ModelAndViewContainer for the current request * @param mavContainer the ModelAndViewContainer for the current request
* @param webRequest the current request * @param webRequest the current request
* @param binderFactory a factory for creating {@link WebDataBinder} instances * @param binderFactory a factory for creating {@link WebDataBinder} instances
* @return the resolved argument value, or {@code null}. * @return the resolved argument value, or {@code null}
* @throws Exception in case of errors with the preparation of argument values * @throws Exception in case of errors with the preparation of argument values
*/ */
Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,

21
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolverComposite.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -66,13 +66,11 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
/** /**
* Iterate over registered {@link HandlerMethodArgumentResolver}s and invoke the one that supports it. * Iterate over registered {@link HandlerMethodArgumentResolver}s and invoke the one that supports it.
* @exception IllegalStateException if no suitable {@link HandlerMethodArgumentResolver} is found. * @throws IllegalStateException if no suitable {@link HandlerMethodArgumentResolver} is found.
*/ */
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
HandlerMethodArgumentResolver resolver = getArgumentResolver(parameter); HandlerMethodArgumentResolver resolver = getArgumentResolver(parameter);
Assert.notNull(resolver, "Unknown parameter type [" + parameter.getParameterType().getName() + "]"); Assert.notNull(resolver, "Unknown parameter type [" + parameter.getParameterType().getName() + "]");
@ -103,18 +101,17 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
/** /**
* Add the given {@link HandlerMethodArgumentResolver}. * Add the given {@link HandlerMethodArgumentResolver}.
*/ */
public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver argumentResolver) { public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver resolver) {
this.argumentResolvers.add(argumentResolver); this.argumentResolvers.add(resolver);
return this; return this;
} }
/** /**
* Add the given {@link HandlerMethodArgumentResolver}s. * Add the given {@link HandlerMethodArgumentResolver}s.
*/ */
public HandlerMethodArgumentResolverComposite addResolvers( public HandlerMethodArgumentResolverComposite addResolvers(List<? extends HandlerMethodArgumentResolver> resolvers) {
List<? extends HandlerMethodArgumentResolver> argumentResolvers) { if (resolvers != null) {
if (argumentResolvers != null) { for (HandlerMethodArgumentResolver resolver : resolvers) {
for (HandlerMethodArgumentResolver resolver : argumentResolvers) {
this.argumentResolvers.add(resolver); this.argumentResolvers.add(resolver);
} }
} }

8
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -25,6 +25,7 @@ import org.springframework.web.context.request.NativeWebRequest;
* *
* @author Arjen Poutsma * @author Arjen Poutsma
* @since 3.1 * @since 3.1
* @see HandlerMethodArgumentResolver
*/ */
public interface HandlerMethodReturnValueHandler { public interface HandlerMethodReturnValueHandler {
@ -44,9 +45,8 @@ public interface HandlerMethodReturnValueHandler {
* to indicate the response has been handled directly. * to indicate the response has been handled directly.
* @param returnValue the value returned from the handler method * @param returnValue the value returned from the handler method
* @param returnType the type of the return value. This type must have * @param returnType the type of the return value. This type must have
* previously been passed to * previously been passed to {@link #supportsReturnType} which must
* {@link #supportsReturnType(org.springframework.core.MethodParameter)} * have returned {@code true}.
* and it must have returned {@code true}
* @param mavContainer the ModelAndViewContainer for the current request * @param mavContainer the ModelAndViewContainer for the current request
* @param webRequest the current request * @param webRequest the current request
* @throws Exception if the return value handling results in an error * @throws Exception if the return value handling results in an error

23
spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodReturnValueHandlerComposite.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -22,6 +22,7 @@ import java.util.List;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.NativeWebRequest;
@ -40,6 +41,7 @@ public class HandlerMethodReturnValueHandlerComposite implements HandlerMethodRe
private final List<HandlerMethodReturnValueHandler> returnValueHandlers = private final List<HandlerMethodReturnValueHandler> returnValueHandlers =
new ArrayList<HandlerMethodReturnValueHandler>(); new ArrayList<HandlerMethodReturnValueHandler>();
/** /**
* Return a read-only list with the registered handlers, or an empty list. * Return a read-only list with the registered handlers, or an empty list.
*/ */
@ -58,13 +60,11 @@ public class HandlerMethodReturnValueHandlerComposite implements HandlerMethodRe
/** /**
* Iterate over registered {@link HandlerMethodReturnValueHandler}s and invoke the one that supports it. * Iterate over registered {@link HandlerMethodReturnValueHandler}s and invoke the one that supports it.
* @exception IllegalStateException if no suitable {@link HandlerMethodReturnValueHandler} is found. * @throws IllegalStateException if no suitable {@link HandlerMethodReturnValueHandler} is found.
*/ */
@Override @Override
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest webRequest)
throws Exception {
HandlerMethodReturnValueHandler handler = getReturnValueHandler(returnType); HandlerMethodReturnValueHandler handler = getReturnValueHandler(returnType);
Assert.notNull(handler, "Unknown return value type [" + returnType.getParameterType().getName() + "]"); Assert.notNull(handler, "Unknown return value type [" + returnType.getParameterType().getName() + "]");
@ -90,18 +90,17 @@ public class HandlerMethodReturnValueHandlerComposite implements HandlerMethodRe
/** /**
* Add the given {@link HandlerMethodReturnValueHandler}. * Add the given {@link HandlerMethodReturnValueHandler}.
*/ */
public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValuehandler) { public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler handler) {
returnValueHandlers.add(returnValuehandler); returnValueHandlers.add(handler);
return this; return this;
} }
/** /**
* Add the given {@link HandlerMethodReturnValueHandler}s. * Add the given {@link HandlerMethodReturnValueHandler}s.
*/ */
public HandlerMethodReturnValueHandlerComposite addHandlers( public HandlerMethodReturnValueHandlerComposite addHandlers(List<? extends HandlerMethodReturnValueHandler> handlers) {
List<? extends HandlerMethodReturnValueHandler> returnValueHandlers) { if (handlers != null) {
if (returnValueHandlers != null) { for (HandlerMethodReturnValueHandler handler : handlers) {
for (HandlerMethodReturnValueHandler handler : returnValueHandlers) {
this.returnValueHandlers.add(handler); this.returnValueHandlers.add(handler);
} }
} }

12
spring-web/src/main/java/org/springframework/web/method/support/ModelAndViewContainer.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -58,11 +58,6 @@ public class ModelAndViewContainer {
private final SessionStatus sessionStatus = new SimpleSessionStatus(); private final SessionStatus sessionStatus = new SimpleSessionStatus();
/**
* Create a new instance.
*/
public ModelAndViewContainer() {
}
/** /**
* Set a view name to be resolved by the DispatcherServlet via a ViewResolver. * Set a view name to be resolved by the DispatcherServlet via a ViewResolver.
@ -145,7 +140,7 @@ public class ModelAndViewContainer {
* Whether to use the default model or the redirect model. * Whether to use the default model or the redirect model.
*/ */
private boolean useDefaultModel() { private boolean useDefaultModel() {
return !this.redirectModelScenario || ((this.redirectModel == null) && !this.ignoreDefaultModelOnRedirect); return (!this.redirectModelScenario || (this.redirectModel == null && !this.ignoreDefaultModelOnRedirect));
} }
/** /**
@ -183,7 +178,7 @@ public class ModelAndViewContainer {
* signal that session processing is complete. * signal that session processing is complete.
*/ */
public SessionStatus getSessionStatus() { public SessionStatus getSessionStatus() {
return sessionStatus; return this.sessionStatus;
} }
/** /**
@ -243,6 +238,7 @@ public class ModelAndViewContainer {
return getModel().containsAttribute(name); return getModel().containsAttribute(name);
} }
/** /**
* Return diagnostic information. * Return diagnostic information.
*/ */

11
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AsyncTaskMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -39,16 +39,15 @@ public class AsyncTaskMethodReturnValueHandler implements HandlerMethodReturnVal
this.beanFactory = beanFactory; this.beanFactory = beanFactory;
} }
@Override @Override
public boolean supportsReturnType(MethodParameter returnType) { public boolean supportsReturnType(MethodParameter returnType) {
Class<?> paramType = returnType.getParameterType(); return WebAsyncTask.class.isAssignableFrom(returnType.getParameterType());
return WebAsyncTask.class.isAssignableFrom(paramType);
} }
@Override @Override
public void handleReturnValue(Object returnValue, public void handleReturnValue(Object returnValue, MethodParameter returnType,
MethodParameter returnType, ModelAndViewContainer mavContainer, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
NativeWebRequest webRequest) throws Exception {
if (returnValue == null) { if (returnValue == null) {
mavContainer.setRequestHandled(true); mavContainer.setRequestHandled(true);

10
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/CallableMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -34,14 +34,12 @@ public class CallableMethodReturnValueHandler implements HandlerMethodReturnValu
@Override @Override
public boolean supportsReturnType(MethodParameter returnType) { public boolean supportsReturnType(MethodParameter returnType) {
Class<?> paramType = returnType.getParameterType(); return Callable.class.isAssignableFrom(returnType.getParameterType());
return Callable.class.isAssignableFrom(paramType);
} }
@Override @Override
public void handleReturnValue(Object returnValue, public void handleReturnValue(Object returnValue, MethodParameter returnType,
MethodParameter returnType, ModelAndViewContainer mavContainer, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
NativeWebRequest webRequest) throws Exception {
if (returnValue == null) { if (returnValue == null) {
mavContainer.setRequestHandled(true); mavContainer.setRequestHandled(true);

12
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/DeferredResultMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -18,8 +18,8 @@ package org.springframework.web.servlet.mvc.method.annotation;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
import org.springframework.web.context.request.NativeWebRequest; import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.context.request.async.WebAsyncUtils;
import org.springframework.web.context.request.async.DeferredResult; import org.springframework.web.context.request.async.DeferredResult;
import org.springframework.web.context.request.async.WebAsyncUtils;
import org.springframework.web.method.support.HandlerMethodReturnValueHandler; import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.ModelAndViewContainer; import org.springframework.web.method.support.ModelAndViewContainer;
@ -33,14 +33,12 @@ public class DeferredResultMethodReturnValueHandler implements HandlerMethodRetu
@Override @Override
public boolean supportsReturnType(MethodParameter returnType) { public boolean supportsReturnType(MethodParameter returnType) {
Class<?> paramType = returnType.getParameterType(); return DeferredResult.class.isAssignableFrom(returnType.getParameterType());
return DeferredResult.class.isAssignableFrom(paramType);
} }
@Override @Override
public void handleReturnValue(Object returnValue, public void handleReturnValue(Object returnValue, MethodParameter returnType,
MethodParameter returnType, ModelAndViewContainer mavContainer, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
NativeWebRequest webRequest) throws Exception {
if (returnValue == null) { if (returnValue == null) {
mavContainer.setRequestHandled(true); mavContainer.setRequestHandled(true);

8
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -48,10 +48,8 @@ public class ModelAndViewMethodReturnValueHandler implements HandlerMethodReturn
} }
@Override @Override
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest webRequest)
throws Exception {
if (returnValue == null) { if (returnValue == null) {
mavContainer.setRequestHandled(true); mavContainer.setRequestHandled(true);

14
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ModelAndViewResolverMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -57,6 +57,7 @@ public class ModelAndViewResolverMethodReturnValueHandler implements HandlerMeth
private final ModelAttributeMethodProcessor modelAttributeProcessor = new ModelAttributeMethodProcessor(true); private final ModelAttributeMethodProcessor modelAttributeProcessor = new ModelAttributeMethodProcessor(true);
/** /**
* Create a new instance. * Create a new instance.
*/ */
@ -64,6 +65,7 @@ public class ModelAndViewResolverMethodReturnValueHandler implements HandlerMeth
this.mavResolvers = mavResolvers; this.mavResolvers = mavResolvers;
} }
/** /**
* Always returns {@code true}. See class-level note. * Always returns {@code true}. See class-level note.
*/ */
@ -73,17 +75,15 @@ public class ModelAndViewResolverMethodReturnValueHandler implements HandlerMeth
} }
@Override @Override
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest request)
throws Exception {
if (this.mavResolvers != null) { if (this.mavResolvers != null) {
for (ModelAndViewResolver mavResolver : this.mavResolvers) { for (ModelAndViewResolver mavResolver : this.mavResolvers) {
Class<?> handlerType = returnType.getContainingClass(); Class<?> handlerType = returnType.getContainingClass();
Method method = returnType.getMethod(); Method method = returnType.getMethod();
ExtendedModelMap model = (ExtendedModelMap) mavContainer.getModel(); ExtendedModelMap model = (ExtendedModelMap) mavContainer.getModel();
ModelAndView mav = mavResolver.resolveModelAndView(method, handlerType, returnValue, model, request); ModelAndView mav = mavResolver.resolveModelAndView(method, handlerType, returnValue, model, webRequest);
if (mav != ModelAndViewResolver.UNRESOLVED) { if (mav != ModelAndViewResolver.UNRESOLVED) {
mavContainer.addAllAttributes(mav.getModel()); mavContainer.addAllAttributes(mav.getModel());
mavContainer.setViewName(mav.getViewName()); mavContainer.setViewName(mav.getViewName());
@ -97,7 +97,7 @@ public class ModelAndViewResolverMethodReturnValueHandler implements HandlerMeth
// No suitable ModelAndViewResolver... // No suitable ModelAndViewResolver...
if (this.modelAttributeProcessor.supportsReturnType(returnType)) { if (this.modelAttributeProcessor.supportsReturnType(returnType)) {
this.modelAttributeProcessor.handleReturnValue(returnValue, returnType, mavContainer, request); this.modelAttributeProcessor.handleReturnValue(returnValue, returnType, mavContainer, webRequest);
} }
else { else {
throw new UnsupportedOperationException("Unexpected return type: " + throw new UnsupportedOperationException("Unexpected return type: " +

8
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/PathVariableMapMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -44,9 +44,9 @@ public class PathVariableMapMethodArgumentResolver implements HandlerMethodArgum
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
PathVariable annot = parameter.getParameterAnnotation(PathVariable.class); PathVariable ann = parameter.getParameterAnnotation(PathVariable.class);
return ((annot != null) && (Map.class.isAssignableFrom(parameter.getParameterType())) return (ann != null && (Map.class.isAssignableFrom(parameter.getParameterType()))
&& (!StringUtils.hasText(annot.value()))); && !StringUtils.hasText(ann.value()));
} }
/** /**

18
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RedirectAttributesMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -32,10 +32,12 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributesModelMap;
/** /**
* Resolves method arguments of type {@link RedirectAttributes}. * Resolves method arguments of type {@link RedirectAttributes}.
* *
* <p>This resolver must be listed ahead of {@link org.springframework.web.method.annotation.ModelMethodProcessor} and * <p>This resolver must be listed ahead of
* {@link org.springframework.web.method.annotation.MapMethodProcessor}, which support {@link Map} and {@link Model} * {@link org.springframework.web.method.annotation.ModelMethodProcessor} and
* arguments both of which are "super" types of {@code RedirectAttributes} * {@link org.springframework.web.method.annotation.MapMethodProcessor},
* and would also attempt to resolve a {@code RedirectAttributes} argument. * which support {@link Map} and {@link Model} arguments both of which are
* "super" types of {@code RedirectAttributes} and would also attempt to
* resolve a {@code RedirectAttributes} argument.
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 3.1 * @since 3.1
@ -48,10 +50,8 @@ public class RedirectAttributesMethodArgumentResolver implements HandlerMethodAr
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
DataBinder dataBinder = binderFactory.createBinder(webRequest, null, null); DataBinder dataBinder = binderFactory.createBinder(webRequest, null, null);
ModelMap redirectAttributes = new RedirectAttributesModelMap(dataBinder); ModelMap redirectAttributes = new RedirectAttributesModelMap(dataBinder);

25
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestResponseBodyMethodProcessor.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -73,6 +73,7 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
super(messageConverters, contentNegotiationManager); super(messageConverters, contentNegotiationManager);
} }
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
return parameter.hasParameterAnnotation(RequestBody.class); return parameter.hasParameterAnnotation(RequestBody.class);
@ -80,12 +81,11 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
@Override @Override
public boolean supportsReturnType(MethodParameter returnType) { public boolean supportsReturnType(MethodParameter returnType) {
return ((AnnotationUtils.findAnnotation(returnType.getContainingClass(), ResponseBody.class) != null) || return (AnnotationUtils.findAnnotation(returnType.getContainingClass(), ResponseBody.class) != null ||
(returnType.getMethodAnnotation(ResponseBody.class) != null)); returnType.getMethodAnnotation(ResponseBody.class) != null);
} }
/** /**
* {@inheritDoc}
* @throws MethodArgumentNotValidException if validation fails * @throws MethodArgumentNotValidException if validation fails
* @throws HttpMessageNotReadableException if {@link RequestBody#required()} * @throws HttpMessageNotReadableException if {@link RequestBody#required()}
* is {@code true} and there is no body content or if there is no suitable * is {@code true} and there is no body content or if there is no suitable
@ -96,25 +96,20 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
Object argument = readWithMessageConverters(webRequest, parameter, parameter.getGenericParameterType()); Object argument = readWithMessageConverters(webRequest, parameter, parameter.getGenericParameterType());
String name = Conventions.getVariableNameForParameter(parameter); String name = Conventions.getVariableNameForParameter(parameter);
WebDataBinder binder = binderFactory.createBinder(webRequest, argument, name); WebDataBinder binder = binderFactory.createBinder(webRequest, argument, name);
if (argument != null) { if (argument != null) {
validate(binder, parameter); validate(binder, parameter);
} }
mavContainer.addAttribute(BindingResult.MODEL_KEY_PREFIX + name, binder.getBindingResult()); mavContainer.addAttribute(BindingResult.MODEL_KEY_PREFIX + name, binder.getBindingResult());
return argument; return argument;
} }
private void validate(WebDataBinder binder, MethodParameter parameter) throws Exception, MethodArgumentNotValidException { private void validate(WebDataBinder binder, MethodParameter parameter) throws Exception {
Annotation[] annotations = parameter.getParameterAnnotations(); Annotation[] annotations = parameter.getParameterAnnotations();
for (Annotation annot : annotations) { for (Annotation ann : annotations) {
if (annot.annotationType().getSimpleName().startsWith("Valid")) { if (ann.annotationType().getSimpleName().startsWith("Valid")) {
Object hints = AnnotationUtils.getValue(annot); Object hints = AnnotationUtils.getValue(ann);
binder.validate(hints instanceof Object[] ? (Object[]) hints : new Object[] {hints}); binder.validate(hints instanceof Object[] ? (Object[]) hints : new Object[] {hints});
BindingResult bindingResult = binder.getBindingResult(); BindingResult bindingResult = binder.getBindingResult();
if (bindingResult.hasErrors()) { if (bindingResult.hasErrors()) {
@ -148,8 +143,8 @@ public class RequestResponseBodyMethodProcessor extends AbstractMessageConverter
final HttpServletRequest servletRequest = webRequest.getNativeRequest(HttpServletRequest.class); final HttpServletRequest servletRequest = webRequest.getNativeRequest(HttpServletRequest.class);
HttpInputMessage inputMessage = new ServletServerHttpRequest(servletRequest); HttpInputMessage inputMessage = new ServletServerHttpRequest(servletRequest);
RequestBody annot = methodParam.getParameterAnnotation(RequestBody.class); RequestBody ann = methodParam.getParameterAnnotation(RequestBody.class);
if (!annot.required()) { if (!ann.required()) {
InputStream inputStream = inputMessage.getBody(); InputStream inputStream = inputMessage.getBody();
if (inputStream == null) { if (inputStream == null) {
return null; return null;

31
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletModelAttributeMethodProcessor.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -18,7 +18,6 @@ package org.springframework.web.servlet.mvc.method.annotation;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
import javax.servlet.ServletRequest; import javax.servlet.ServletRequest;
import org.springframework.core.MethodParameter; import org.springframework.core.MethodParameter;
@ -36,7 +35,7 @@ import org.springframework.web.method.annotation.ModelAttributeMethodProcessor;
import org.springframework.web.servlet.HandlerMapping; import org.springframework.web.servlet.HandlerMapping;
/** /**
* A Servlet-specific {@link org.springframework.web.method.annotation.ModelAttributeMethodProcessor} that applies data * A Servlet-specific {@link ModelAttributeMethodProcessor} that applies data
* binding through a WebDataBinder of type {@link ServletRequestDataBinder}. * binding through a WebDataBinder of type {@link ServletRequestDataBinder}.
* *
* <p>Also adds a fall-back strategy to instantiate the model attribute from a * <p>Also adds a fall-back strategy to instantiate the model attribute from a
@ -57,6 +56,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
super(annotationNotRequired); super(annotationNotRequired);
} }
/** /**
* Instantiate the model attribute from a URI template variable or from a * Instantiate the model attribute from a URI template variable or from a
* request parameter if the name matches to the model attribute name and * request parameter if the name matches to the model attribute name and
@ -65,10 +65,8 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
* @see #createAttributeFromRequestValue(String, String, MethodParameter, WebDataBinderFactory, NativeWebRequest) * @see #createAttributeFromRequestValue(String, String, MethodParameter, WebDataBinderFactory, NativeWebRequest)
*/ */
@Override @Override
protected final Object createAttribute(String attributeName, protected final Object createAttribute(String attributeName, MethodParameter parameter,
MethodParameter parameter, WebDataBinderFactory binderFactory, NativeWebRequest request) throws Exception {
WebDataBinderFactory binderFactory,
NativeWebRequest request) throws Exception {
String value = getRequestValueForAttribute(attributeName, request); String value = getRequestValueForAttribute(attributeName, request);
if (value != null) { if (value != null) {
@ -106,9 +104,9 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected final Map<String, String> getUriTemplateVariables(NativeWebRequest request) { protected final Map<String, String> getUriTemplateVariables(NativeWebRequest request) {
Map<String, String> variables = Map<String, String> variables =
(Map<String, String>) request.getAttribute( (Map<String, String>) request.getAttribute(
HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST); HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
return (variables != null) ? variables : Collections.<String, String>emptyMap(); return (variables != null ? variables : Collections.<String, String>emptyMap());
} }
/** /**
@ -124,11 +122,10 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
* @return the created model attribute, or {@code null} * @return the created model attribute, or {@code null}
* @throws Exception * @throws Exception
*/ */
protected Object createAttributeFromRequestValue(String sourceValue, protected Object createAttributeFromRequestValue(String sourceValue, String attributeName,
String attributeName, MethodParameter parameter, WebDataBinderFactory binderFactory, NativeWebRequest request)
MethodParameter parameter, throws Exception {
WebDataBinderFactory binderFactory,
NativeWebRequest request) throws Exception {
DataBinder binder = binderFactory.createBinder(request, null, attributeName); DataBinder binder = binderFactory.createBinder(request, null, attributeName);
ConversionService conversionService = binder.getConversionService(); ConversionService conversionService = binder.getConversionService();
if (conversionService != null) { if (conversionService != null) {
@ -142,8 +139,8 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
} }
/** /**
* {@inheritDoc} * This implementation downcasts {@link WebDataBinder} to
* <p>Downcast {@link WebDataBinder} to {@link ServletRequestDataBinder} before binding. * {@link ServletRequestDataBinder} before binding.
* @see ServletRequestDataBinderFactory * @see ServletRequestDataBinderFactory
*/ */
@Override @Override

11
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletRequestMethodArgumentResolver.java

@ -16,7 +16,6 @@
package org.springframework.web.servlet.mvc.method.annotation; package org.springframework.web.servlet.mvc.method.annotation;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.Reader; import java.io.Reader;
import java.security.Principal; import java.security.Principal;
@ -64,7 +63,7 @@ public class ServletRequestMethodArgumentResolver implements HandlerMethodArgume
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
Class<?> paramType = parameter.getParameterType(); Class<?> paramType = parameter.getParameterType();
return WebRequest.class.isAssignableFrom(paramType) || return (WebRequest.class.isAssignableFrom(paramType) ||
ServletRequest.class.isAssignableFrom(paramType) || ServletRequest.class.isAssignableFrom(paramType) ||
MultipartRequest.class.isAssignableFrom(paramType) || MultipartRequest.class.isAssignableFrom(paramType) ||
HttpSession.class.isAssignableFrom(paramType) || HttpSession.class.isAssignableFrom(paramType) ||
@ -74,14 +73,12 @@ public class ServletRequestMethodArgumentResolver implements HandlerMethodArgume
"java.time.ZoneId".equals(paramType.getName()) || "java.time.ZoneId".equals(paramType.getName()) ||
InputStream.class.isAssignableFrom(paramType) || InputStream.class.isAssignableFrom(paramType) ||
Reader.class.isAssignableFrom(paramType) || Reader.class.isAssignableFrom(paramType) ||
HttpMethod.class.equals(paramType); HttpMethod.class.equals(paramType));
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws IOException {
Class<?> paramType = parameter.getParameterType(); Class<?> paramType = parameter.getParameterType();
if (WebRequest.class.isAssignableFrom(paramType)) { if (WebRequest.class.isAssignableFrom(paramType)) {

16
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ServletResponseMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -16,11 +16,9 @@
package org.springframework.web.servlet.mvc.method.annotation; package org.springframework.web.servlet.mvc.method.annotation;
import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.Writer; import java.io.Writer;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import javax.servlet.ServletResponse; import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@ -47,9 +45,9 @@ public class ServletResponseMethodArgumentResolver implements HandlerMethodArgum
@Override @Override
public boolean supportsParameter(MethodParameter parameter) { public boolean supportsParameter(MethodParameter parameter) {
Class<?> paramType = parameter.getParameterType(); Class<?> paramType = parameter.getParameterType();
return ServletResponse.class.isAssignableFrom(paramType) return (ServletResponse.class.isAssignableFrom(paramType) ||
|| OutputStream.class.isAssignableFrom(paramType) OutputStream.class.isAssignableFrom(paramType) ||
|| Writer.class.isAssignableFrom(paramType); Writer.class.isAssignableFrom(paramType));
} }
/** /**
@ -59,10 +57,8 @@ public class ServletResponseMethodArgumentResolver implements HandlerMethodArgum
* {@code null}, the request is considered directly handled. * {@code null}, the request is considered directly handled.
*/ */
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws IOException {
if (mavContainer != null) { if (mavContainer != null) {
mavContainer.setRequestHandled(true); mavContainer.setRequestHandled(true);

8
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/UriComponentsBuilderMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -43,10 +43,8 @@ public class UriComponentsBuilderMethodArgumentResolver implements HandlerMethod
} }
@Override @Override
public Object resolveArgument( public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
NativeWebRequest webRequest, WebDataBinderFactory binderFactory)
throws Exception {
HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class); HttpServletRequest request = webRequest.getNativeRequest(HttpServletRequest.class);
return ServletUriComponentsBuilder.fromServletMapping(request); return ServletUriComponentsBuilder.fromServletMapping(request);

8
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ViewMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -46,10 +46,8 @@ public class ViewMethodReturnValueHandler implements HandlerMethodReturnValueHan
} }
@Override @Override
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest webRequest)
throws Exception {
if (returnValue == null) { if (returnValue == null) {
return; return;

8
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/ViewNameMethodReturnValueHandler.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 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.
@ -47,10 +47,8 @@ public class ViewNameMethodReturnValueHandler implements HandlerMethodReturnValu
} }
@Override @Override
public void handleReturnValue( public void handleReturnValue(Object returnValue, MethodParameter returnType,
Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception {
ModelAndViewContainer mavContainer, NativeWebRequest webRequest)
throws Exception {
if (returnValue == null) { if (returnValue == null) {
return; return;

5
spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/ServletAnnotationControllerHandlerMethodTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2014 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.
@ -1568,7 +1568,6 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
@Test @Test
public void restController() throws Exception { public void restController() throws Exception {
initServletWithControllers(ThisWillActuallyRun.class); initServletWithControllers(ThisWillActuallyRun.class);
MockHttpServletRequest request = new MockHttpServletRequest("GET", "/"); MockHttpServletRequest request = new MockHttpServletRequest("GET", "/");
@ -3039,7 +3038,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
} }
// Test cases deleted from the original SevletAnnotationControllerTests: // Test cases deleted from the original ServletAnnotationControllerTests:
// @Ignore("Controller interface => no method-level @RequestMapping annotation") // @Ignore("Controller interface => no method-level @RequestMapping annotation")
// public void standardHandleMethod() throws Exception { // public void standardHandleMethod() throws Exception {

Loading…
Cancel
Save