diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java index d0f93ef87c..d6e43ec1fd 100644 --- a/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java +++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java @@ -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. @@ -243,6 +243,7 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint, private String toString(boolean includeModifier, boolean includeReturnTypeAndArgs, boolean useLongReturnAndArgumentTypeName, boolean useLongTypeName) { + StringBuilder sb = new StringBuilder(); if (includeModifier) { sb.append(Modifier.toString(getModifiers())); @@ -262,8 +263,9 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint, return sb.toString(); } - private void appendTypes(StringBuilder sb, Class>[] types, - boolean includeArgs, boolean useLongReturnAndArgumentTypeName) { + private void appendTypes(StringBuilder sb, Class>[] types, boolean includeArgs, + boolean useLongReturnAndArgumentTypeName) { + if (includeArgs) { for (int size = types.length, i = 0; i < size; i++) { appendType(sb, types[i], useLongReturnAndArgumentTypeName); diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java index 9739a62f8f..2484f87c64 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/BeanPostProcessor.java @@ -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. @@ -48,8 +48,8 @@ public interface BeanPostProcessor { * The returned bean instance may be a wrapper around the original. * @param bean the new bean instance * @param beanName the name of the bean - * @return the bean instance to use, either the original or a wrapped one; if - * {@code null}, no subsequent BeanPostProcessors will be invoked + * @return the bean instance to use, either the original or a wrapped one; + * if {@code null}, no subsequent BeanPostProcessors will be invoked * @throws org.springframework.beans.BeansException in case of errors * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet */ @@ -69,8 +69,8 @@ public interface BeanPostProcessor { * in contrast to all other BeanPostProcessor callbacks. * @param bean the new bean instance * @param beanName the name of the bean - * @return the bean instance to use, either the original or a wrapped one; if - * {@code null}, no subsequent BeanPostProcessors will be invoked + * @return the bean instance to use, either the original or a wrapped one; + * if {@code null}, no subsequent BeanPostProcessors will be invoked * @throws org.springframework.beans.BeansException in case of errors * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet * @see org.springframework.beans.factory.FactoryBean diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java index 39721647a3..4934aa08ce 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -37,11 +37,12 @@ import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.DestructionAwareBeanPostProcessor; import org.springframework.util.Assert; import org.springframework.util.ClassUtils; +import org.springframework.util.CollectionUtils; import org.springframework.util.ReflectionUtils; /** - * Adapter that implements the {@link DisposableBean} and {@link Runnable} interfaces - * performing various destruction steps on a given bean instance: + * Adapter that implements the {@link DisposableBean} and {@link Runnable} + * interfaces performing various destruction steps on a given bean instance: *
Thrown exceptions are handled via a call to {@link #handleReflectionException(Exception)}. * @param field the field to set * @param target the target object on which to set the field - * @param value the value to set; may be {@code null} + * @param value the value to set (may be {@code null}) */ public static void setField(Field field, Object target, Object value) { try { @@ -284,12 +284,11 @@ public abstract class ReflectionUtils { /** * Rethrow the given {@link Throwable exception}, which is presumably the - * target exception of an {@link InvocationTargetException}. Should - * only be called if no checked exception is expected to be thrown by the - * target method. + * target exception of an {@link InvocationTargetException}. + * Should only be called if no checked exception is expected to be thrown + * by the target method. *
Rethrows the underlying exception cast to an {@link RuntimeException} or - * {@link Error} if appropriate; otherwise, throws an - * {@link IllegalStateException}. + * {@link Error} if appropriate; otherwise, throws an {@link IllegalStateException}. * @param ex the exception to rethrow * @throws RuntimeException the rethrown exception */ @@ -305,12 +304,11 @@ public abstract class ReflectionUtils { /** * Rethrow the given {@link Throwable exception}, which is presumably the - * target exception of an {@link InvocationTargetException}. Should - * only be called if no checked exception is expected to be thrown by the - * target method. + * target exception of an {@link InvocationTargetException}. + * Should only be called if no checked exception is expected to be thrown + * by the target method. *
Rethrows the underlying exception cast to an {@link Exception} or - * {@link Error} if appropriate; otherwise, throws an - * {@link IllegalStateException}. + * {@link Error} if appropriate; otherwise, throws an {@link IllegalStateException}. * @param ex the exception to rethrow * @throws Exception the rethrown exception (in case of a checked exception) */ diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java index 99397e37e4..82a8296270 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -43,7 +43,6 @@ public class SqlParameter { /** Used for types that are user-named like: STRUCT, DISTINCT, JAVA_OBJECT, named array types */ private String typeName; - /** The scale to apply in case of a NUMERIC or DECIMAL type, if any */ private Integer scale; @@ -126,7 +125,7 @@ public class SqlParameter { /** - * Return the name of the parameter. + * Return the name of the parameter, or {@code null} if anonymous. */ public String getName() { return this.name; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java index df58d5d016..f4d37dd0bf 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -39,18 +39,19 @@ import org.springframework.jdbc.core.namedparam.SqlParameterSource; * the JDBC driver. Since we rely on the JDBC driver, this "auto-detection" * can only be used for databases that are known to provide accurate meta data. * These currently include Derby, MySQL, Microsoft SQL Server, Oracle, DB2, - * Sybase and PostgreSQL. For any other databases you are required to declare all - * parameters explicitly. You can of course declare all parameters explicitly even - * if the database provides the necessary meta data. In that case your declared - * parameters will take precedence. You can also turn off any meta data processing - * if you want to use parameter names that do not match what is declared during - * the stored procedure compilation. + * Sybase and PostgreSQL. For any other databases you are required to declare + * all parameters explicitly. You can of course declare all parameters + * explicitly even if the database provides the necessary meta data. In that + * case your declared parameters will take precedence. You can also turn off + * any metadata processing if you want to use parameter names that do not + * match what is declared during the stored procedure compilation. * *
The actual insert is being handled using Spring's * {@link org.springframework.jdbc.core.JdbcTemplate}. * - *
Many of the configuration methods return the current instance of the SimpleJdbcCall - * to provide the ability to chain multiple ones together in a "fluent" interface style. + *
Many of the configuration methods return the current instance of the + * SimpleJdbcCall in order to provide the ability to chain multiple ones + * together in a "fluent" interface style. * * @author Thomas Risberg * @since 2.5 @@ -60,8 +61,8 @@ import org.springframework.jdbc.core.namedparam.SqlParameterSource; public class SimpleJdbcCall extends AbstractJdbcCall implements SimpleJdbcCallOperations { /** - * Constructor that takes one parameter with the JDBC DataSource to use when creating the - * JdbcTemplate. + * Constructor that takes one parameter with the JDBC DataSource to use when + * creating the underlying JdbcTemplate. * @param dataSource the {@code DataSource} to use * @see org.springframework.jdbc.core.JdbcTemplate#setDataSource */ diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java index aebf1994be..b11962c245 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcCallTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 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. @@ -103,8 +103,7 @@ public class SimpleJdbcCallTests { adder.declareParameters( new SqlParameter("amount", Types.INTEGER), new SqlParameter("custid", Types.INTEGER), - new SqlOutParameter("newid", - Types.INTEGER)); + new SqlOutParameter("newid", Types.INTEGER)); Number newId = adder.executeObject(Number.class, new MapSqlParameterSource(). addValue("amount", 1103). addValue("custid", 3)); @@ -120,8 +119,7 @@ public class SimpleJdbcCallTests { adder.declareParameters( new SqlParameter("amount", Types.INTEGER), new SqlParameter("custid", Types.INTEGER), - new SqlOutParameter("newid", - Types.INTEGER)); + new SqlOutParameter("newid", Types.INTEGER)); Number newId = adder.executeObject(Number.class, 1103, 3); assertEquals(4, newId.intValue()); verifyAddInvoiceWithoutMetaData(false); @@ -193,7 +191,8 @@ public class SimpleJdbcCallTests { } - @Test public void testAddInvoiceFuncWithMetaDataUsingArrayParams() throws Exception { + @Test + public void testAddInvoiceFuncWithMetaDataUsingArrayParams() throws Exception { initializeAddInvoiceWithMetaData(true); SimpleJdbcCall adder = new SimpleJdbcCall(dataSource).withFunctionName("add_invoice"); Number newId = adder.executeFunction(Number.class, 1103, 3); @@ -203,8 +202,7 @@ public class SimpleJdbcCallTests { } - private void initializeAddInvoiceWithoutMetaData(boolean isFunction) - throws SQLException { + private void initializeAddInvoiceWithoutMetaData(boolean isFunction) throws SQLException { given(databaseMetaData.getDatabaseProductName()).willReturn("MyDB"); given(databaseMetaData.getUserName()).willReturn("me"); given(databaseMetaData.storesLowerCaseIdentifiers()).willReturn(true); @@ -281,6 +279,6 @@ public class SimpleJdbcCallTests { verify(callableStatement).close(); verify(proceduresResultSet).close(); verify(procedureColumnsResultSet).close(); + } } -} diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethodSelector.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethodSelector.java index 937228fd68..86b0a1fa41 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethodSelector.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/HandlerMethodSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 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. @@ -37,8 +37,8 @@ import org.springframework.util.ReflectionUtils.MethodFilter; public abstract class HandlerMethodSelector { /** - * Selects handler methods for the given handler type. Callers of this method define handler methods - * of interest through the {@link MethodFilter} parameter. + * Select handler methods for the given handler type. + *
Callers define handler methods of interest through the {@link MethodFilter} parameter. * @param handlerType the handler type to search handler methods on * @param handlerMethodFilter a {@link MethodFilter} to help recognize handler methods of interest * @return the selected methods, or an empty set diff --git a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java index 60b8ad4587..3b93ee4d33 100644 --- a/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java +++ b/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/InvocableHandlerMethod.java @@ -29,8 +29,8 @@ import org.springframework.messaging.handler.HandlerMethod; import org.springframework.util.ReflectionUtils; /** - * Invokes the handler method for a given message after resolving its method argument - * values through registered {@link HandlerMethodArgumentResolver}s. + * Provides a method for invoking the handler method for a given message after resolving its + * method argument values through registered {@link HandlerMethodArgumentResolver}s. * *
Use {@link #setMessageMethodArgumentResolvers(HandlerMethodArgumentResolver)} * to customize the list of argument resolvers. @@ -92,18 +92,28 @@ public class InvocableHandlerMethod extends HandlerMethod { /** - * Invoke the method with the given message. - * @throws Exception raised if no suitable argument resolver can be found, - * or the method raised an exception + * Invoke the method after resolving its argument values in the context of the given message. + *
Argument values are commonly resolved through {@link HandlerMethodArgumentResolver}s.
+ * The {@code providedArgs} parameter however may supply argument values to be used directly,
+ * i.e. without argument resolution.
+ * @param message the current message being processed
+ * @param providedArgs "given" arguments matched by type, not resolved
+ * @return the raw value returned by the invoked method
+ * @exception Exception raised if no suitable argument resolver can be found,
+ * or if the method raised an exception
*/
public Object invoke(Message> message, Object... providedArgs) throws Exception {
Object[] args = getMethodArgumentValues(message, providedArgs);
if (logger.isTraceEnabled()) {
- logger.trace("Resolved arguments: " + Arrays.asList(args));
+ StringBuilder sb = new StringBuilder("Invoking [");
+ sb.append(getBeanType().getSimpleName()).append(".");
+ sb.append(getMethod().getName()).append("] method with arguments ");
+ sb.append(Arrays.asList(args));
+ logger.trace(sb.toString());
}
Object returnValue = doInvoke(args);
if (logger.isTraceEnabled()) {
- logger.trace("Returned value: " + returnValue);
+ logger.trace("Method [" + getMethod().getName() + "] returned [" + returnValue + "]");
}
return returnValue;
}
@@ -135,8 +145,8 @@ public class InvocableHandlerMethod extends HandlerMethod {
}
}
if (args[i] == null) {
- String error = getArgumentResolutionErrorMessage("No suitable resolver for argument", i);
- throw new IllegalStateException(error);
+ String msg = getArgumentResolutionErrorMessage("No suitable resolver for argument", i);
+ throw new IllegalStateException(msg);
}
}
return args;
@@ -149,7 +159,8 @@ public class InvocableHandlerMethod extends HandlerMethod {
}
/**
- * Adds HandlerMethod details such as the controller type and method signature to the given error message.
+ * Adds HandlerMethod details such as the controller type and method
+ * signature to the given error message.
* @param message error message to append the HandlerMethod details to
*/
protected String getDetailedErrorMessage(String message) {
@@ -219,7 +230,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
Class> targetBeanClass = targetBean.getClass();
if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) {
String msg = "The mapped controller method class '" + methodDeclaringClass.getName() +
- "' is not an instance of the actual controller bean instance '" +
+ "' is not an instance of the actual controller bean class '" +
targetBeanClass.getName() + "'. If the controller requires proxying " +
"(e.g. due to @Transactional), please use class-based proxying.";
throw new IllegalStateException(getInvocationErrorMessage(msg, args));
@@ -229,7 +240,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
private String getInvocationErrorMessage(String message, Object[] resolvedArgs) {
StringBuilder sb = new StringBuilder(getDetailedErrorMessage(message));
sb.append("Resolved arguments: \n");
- for (int i=0; i < resolvedArgs.length; i++) {
+ for (int i = 0; i < resolvedArgs.length; i++) {
sb.append("[").append(i).append("] ");
if (resolvedArgs[i] == null) {
sb.append("[null] \n");
diff --git a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java
index a5c7c2b5ff..0811025b83 100644
--- a/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java
+++ b/spring-messaging/src/main/java/org/springframework/messaging/simp/annotation/SendToUser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2014 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,10 +23,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
- * Annotation that indicates the return value of a message-handling method should
- * be sent as a {@link org.springframework.messaging.Message} to the specified
- * destination(s) prepended with {@code "/user/{username}"} where the user
- * name is extracted from the headers of the input message being handled.
+ * Annotation that indicates that the return value of a message-handling method
+ * should be sent as a {@link org.springframework.messaging.Message} to the specified
+ * destination(s) prepended with "/user/{username}" where the user name
+ * is extracted from the headers of the input message being handled.
*
* @author Rossen Stoyanchev
* @since 4.0
@@ -40,9 +40,9 @@ import java.lang.annotation.Target;
public @interface SendToUser {
/**
- * One or more destinations to send a message to. If left unspecified, a
- * default destination is selected based on the destination of the input
- * message being handled.
+ * One or more destinations to send a message to.
+ *
If left unspecified, a default destination is selected based on the + * destination of the input message being handled. * @see org.springframework.messaging.simp.annotation.support.SendToMethodReturnValueHandler */ String[] value() default {}; @@ -50,8 +50,7 @@ public @interface SendToUser { /** * Whether messages should be sent to all sessions associated with the user * or only to the session of the input message being handled. - * - *
By default this is set to {@code true} in which case messages are + *
By default, this is set to {@code true} in which case messages are * broadcast to all sessions. */ boolean broadcast() default true; diff --git a/spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java b/spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java index 65b91ae543..23972879b5 100644 --- a/spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java +++ b/spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java @@ -55,13 +55,6 @@ public class InvocableHandlerMethod extends HandlerMethod { private ParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer(); - /** - * Create an instance from the given handler and method. - */ - public InvocableHandlerMethod(Object bean, Method method) { - super(bean, method); - } - /** * Create an instance from a {@code HandlerMethod}. */ @@ -69,6 +62,13 @@ public class InvocableHandlerMethod extends HandlerMethod { super(handlerMethod); } + /** + * Create an instance from a bean instance and a method. + */ + public InvocableHandlerMethod(Object bean, Method method) { + super(bean, method); + } + /** * Construct a new handler method with the given bean instance, method name and parameters. * @param bean the object bean @@ -112,7 +112,7 @@ public class InvocableHandlerMethod extends HandlerMethod { /** * Invoke the method after resolving its argument values in the context of the given request. *
Argument values are commonly resolved through {@link HandlerMethodArgumentResolver}s. - * The {@code provideArgs} parameter however may supply argument values to be used directly, + * The {@code providedArgs} parameter however may supply argument values to be used directly, * i.e. without argument resolution. Examples of provided argument values include a * {@link WebDataBinder}, a {@link SessionStatus}, or a thrown exception instance. * Provided argument values are checked before argument resolvers. @@ -185,7 +185,8 @@ public class InvocableHandlerMethod extends HandlerMethod { } /** - * Adds HandlerMethod details such as the controller type and method signature to the given error message. + * Adds HandlerMethod details such as the controller type and method + * signature to the given error message. * @param message error message to append the HandlerMethod details to */ protected String getDetailedErrorMessage(String message) { @@ -255,7 +256,7 @@ public class InvocableHandlerMethod extends HandlerMethod { Class> targetBeanClass = targetBean.getClass(); if (!methodDeclaringClass.isAssignableFrom(targetBeanClass)) { String msg = "The mapped controller method class '" + methodDeclaringClass.getName() + - "' is not an instance of the actual controller bean instance '" + + "' is not an instance of the actual controller bean class '" + targetBeanClass.getName() + "'. If the controller requires proxying " + "(e.g. due to @Transactional), please use class-based proxying."; throw new IllegalStateException(getInvocationErrorMessage(msg, args)); @@ -265,7 +266,7 @@ public class InvocableHandlerMethod extends HandlerMethod { private String getInvocationErrorMessage(String message, Object[] resolvedArgs) { StringBuilder sb = new StringBuilder(getDetailedErrorMessage(message)); sb.append("Resolved arguments: \n"); - for (int i=0; i < resolvedArgs.length; i++) { + for (int i = 0; i < resolvedArgs.length; i++) { sb.append("[").append(i).append("] "); if (resolvedArgs[i] == null) { sb.append("[null] \n"); diff --git a/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java b/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java index 3d71c0cdef..17d98f7b8e 100644 --- a/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java +++ b/spring-web/src/main/java/org/springframework/web/util/UriTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 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. @@ -29,10 +29,11 @@ import java.util.regex.Pattern; import org.springframework.util.Assert; /** - * Represents a URI template. A URI template is a URI-like String that contains variables enclosed - * by braces ({@code {}}), which can be expanded to produce an actual URI. + * Represents a URI template. A URI template is a URI-like String that contains variables + * enclosed by braces ({@code {}}), which can be expanded to produce an actual URI. * - *
See {@link #expand(Map)}, {@link #expand(Object[])}, and {@link #match(String)} for example usages. + *
See {@link #expand(Map)}, {@link #expand(Object[])}, and {@link #match(String)}
+ * for example usages.
*
* @author Arjen Poutsma
* @author Juergen Hoeller
@@ -48,6 +49,7 @@ public class UriTemplate implements Serializable {
/** Replaces template variables in the URI template. */
private static final String DEFAULT_VARIABLE_PATTERN = "(.*)";
+
private final UriComponents uriComponents;
private final List This tag must be nested under an argument aware tag.
*
@@ -37,7 +37,17 @@ public class ArgumentTag extends BodyTagSupport {
private boolean valueSet;
- // tag lifecycle
+
+ /**
+ * Set the value of the argument (optional).
+ *
- * Required
- *
- * @param name the parameter name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the value of the parameter
- *
- *
- * Optional. If not set, the tag's body content is evaluated
- *
- * @param value the parameter value
- */
- public void setValue(String value) {
- this.value = value;
- this.valueSet = true;
- }
-
@Override
public void release() {
super.release();
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
index 1dfbe7eceb..5e3a5404e2 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/tags/form/FormTag.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2014 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.
@@ -194,15 +194,18 @@ public class FormTag extends AbstractHtmlElementTag {
}
/**
- * Set the value of the '{@code action}' attribute.
+ * Set the value of the '{@code action}' attribute through a value
+ * that is to be appended to the current servlet path.
* May be a runtime expression.
+ * @since 3.2.3
*/
- public void setServletRelativeAction(String servletRelativeaction) {
- this.servletRelativeAction = (servletRelativeaction != null ? servletRelativeaction : "");
+ public void setServletRelativeAction(String servletRelativeAction) {
+ this.servletRelativeAction = (servletRelativeAction != null ? servletRelativeAction : "");
}
/**
- * Get the value of the '{@code action}' attribute.
+ * Get the servlet-relative value of the '{@code action}' attribute.
+ * @since 3.2.3
*/
protected String getServletRelativeAction() {
return this.servletRelativeAction;
@@ -334,6 +337,7 @@ public class FormTag extends AbstractHtmlElementTag {
return ("get".equalsIgnoreCase(method) || "post".equalsIgnoreCase(method));
}
+
/**
* Writes the opening part of the block '{@code form}' tag and exposes
* the form object name in the {@link javax.servlet.jsp.PageContext}.
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
index 97c9d14bc4..2b902c3665 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/view/ContentNegotiatingViewResolver.java
@@ -30,9 +30,6 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.core.OrderComparator;
@@ -124,6 +121,10 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport
this.contentNegotiationManager = contentNegotiationManager;
}
+ /**
+ * Return the {@link ContentNegotiationManager} to use to determine requested media types.
+ * @since 4.1.9
+ */
public ContentNegotiationManager getContentNegotiationManager() {
return this.contentNegotiationManager;
}
@@ -295,6 +296,7 @@ public class ContentNegotiatingViewResolver extends WebApplicationObjectSupport
}
}
+
@Override
public View resolveViewName(String viewName, Locale locale) throws Exception {
RequestAttributes attrs = RequestContextHolder.getRequestAttributes();
diff --git a/spring-webmvc/src/main/resources/META-INF/spring-form.tld b/spring-webmvc/src/main/resources/META-INF/spring-form.tld
index 7977f2e821..711ca961db 100644
--- a/spring-webmvc/src/main/resources/META-INF/spring-form.tld
+++ b/spring-webmvc/src/main/resources/META-INF/spring-form.tld
@@ -265,7 +265,7 @@