Polishing (in particular updating javadoc references to Apache Commons)
(cherry picked from commit bc6a98c)
This commit is contained in:
parent
f42c53d9be
commit
b352dbfdeb
|
|
@ -78,7 +78,7 @@ public class CommonsPoolTargetSource extends AbstractPoolingTargetSource impleme
|
|||
private byte whenExhaustedAction = GenericObjectPool.DEFAULT_WHEN_EXHAUSTED_ACTION;
|
||||
|
||||
/**
|
||||
* The Jakarta Commons {@code ObjectPool} used to pool target objects
|
||||
* The Apache Commons {@code ObjectPool} used to pool target objects
|
||||
*/
|
||||
private ObjectPool pool;
|
||||
|
||||
|
|
|
|||
|
|
@ -804,7 +804,7 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
|||
|
||||
oldBeanDefinition = this.beanDefinitionMap.get(beanName);
|
||||
if (oldBeanDefinition != null) {
|
||||
if (!this.allowBeanDefinitionOverriding) {
|
||||
if (!isAllowBeanDefinitionOverriding()) {
|
||||
throw new BeanDefinitionStoreException(beanDefinition.getResourceDescription(), beanName,
|
||||
"Cannot register bean definition [" + beanDefinition + "] for bean '" + beanName +
|
||||
"': There is already [" + oldBeanDefinition + "] bound.");
|
||||
|
|
|
|||
|
|
@ -28,12 +28,14 @@ import java.lang.annotation.Target;
|
|||
* <p>Supports formatting by style or custom pattern string.
|
||||
* Can be applied to any JDK {@code java.lang.Number} type.
|
||||
*
|
||||
* <p>For style-based formatting, set the {@link #style} attribute to be the desired {@link Style}.
|
||||
* For custom formatting, set the {@link #pattern} attribute to be the number pattern, such as {@code #, ###.##}.
|
||||
* <p>For style-based formatting, set the {@link #style} attribute to be the
|
||||
* desired {@link Style}. For custom formatting, set the {@link #pattern}
|
||||
* attribute to be the number pattern, such as {@code #, ###.##}.
|
||||
*
|
||||
* <p>Each attribute is mutually exclusive, so only set one attribute per annotation instance
|
||||
* (the one most convenient one for your formatting needs). When the pattern attribute is specified,
|
||||
* it takes precedence over the style attribute. When no annotation attributes are specified,
|
||||
* <p>Each attribute is mutually exclusive, so only set one attribute per
|
||||
* annotation instance (the one most convenient one for your formatting needs).
|
||||
* When the {@link #pattern} attribute is specified, it takes precedence over
|
||||
* the {@link #style} attribute. When no annotation attributes are specified,
|
||||
* the default format applied is style-based with a style of {@link Style#NUMBER}.
|
||||
*
|
||||
* @author Keith Donald
|
||||
|
|
|
|||
|
|
@ -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. You may obtain a copy of
|
||||
|
|
@ -41,7 +41,7 @@ import java.util.Map;
|
|||
* Assert.notNull(clazz, "The class must not be null");
|
||||
* Assert.isTrue(i > 0, "The value must be greater than zero");</pre>
|
||||
*
|
||||
* Mainly for internal use within the framework; consider Jakarta's Commons Lang
|
||||
* Mainly for internal use within the framework; consider Apache's Commons Lang
|
||||
* >= 2.0 for a more comprehensive suite of assertion utilities.
|
||||
*
|
||||
* @author Keith Donald
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -27,7 +27,7 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* Miscellaneous utility methods for number conversion and parsing.
|
||||
* Mainly for internal use within the framework; consider Jakarta's
|
||||
* Mainly for internal use within the framework; consider Apache's
|
||||
* Commons Lang for a more comprehensive suite of string utilities.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -35,7 +35,7 @@ import java.util.TreeSet;
|
|||
* Miscellaneous {@link String} utility methods.
|
||||
*
|
||||
* <p>Mainly for internal use within the framework; consider
|
||||
* <a href="http://jakarta.apache.org/commons/lang/">Jakarta's Commons Lang</a>
|
||||
* <a href="http://jakarta.apache.org/commons/lang/">Apache's Commons Lang</a>
|
||||
* for a more comprehensive suite of String utilities.
|
||||
*
|
||||
* <p>This class delivers some simple functionality that should really
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -83,7 +83,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
|
|||
* <p>This transaction manager can be used as a replacement for the
|
||||
* {@link org.springframework.transaction.jta.JtaTransactionManager} in the single
|
||||
* resource case, as it does not require a container that supports JTA, typically
|
||||
* in combination with a locally defined JDBC DataSource (e.g. a Jakarta Commons
|
||||
* in combination with a locally defined JDBC DataSource (e.g. an Apache Commons
|
||||
* DBCP connection pool). Switching between this local strategy and a JTA
|
||||
* environment is just a matter of configuration!
|
||||
*
|
||||
|
|
@ -126,8 +126,8 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
|
|||
|
||||
/**
|
||||
* Set the JDBC DataSource that this instance should manage transactions for.
|
||||
* <p>This will typically be a locally defined DataSource, for example a
|
||||
* Jakarta Commons DBCP connection pool. Alternatively, you can also drive
|
||||
* <p>This will typically be a locally defined DataSource, for example an
|
||||
* Apache Commons DBCP connection pool. Alternatively, you can also drive
|
||||
* transactions for a non-XA J2EE DataSource fetched from JNDI. For an XA
|
||||
* DataSource, use JtaTransactionManager.
|
||||
* <p>The DataSource specified here should be the target DataSource to manage
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -53,7 +53,7 @@ import org.springframework.util.ClassUtils;
|
|||
* bean definition to a local DataSource (which is simpler and thus recommended).
|
||||
*
|
||||
* <p>If you need a "real" connection pool outside of a J2EE container, consider
|
||||
* <a href="http://jakarta.apache.org/commons/dbcp">Apache's Jakarta Commons DBCP</a>
|
||||
* <a href="http://commons.apache.org/proper/commons-dbcp">Apache Commons DBCP</a>
|
||||
* or <a href="http://sourceforge.net/projects/c3p0">C3P0</a>.
|
||||
* Commons DBCP's BasicDataSource and C3P0's ComboPooledDataSource are full
|
||||
* connection pool beans, supporting the same basic properties as this class
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -26,8 +26,8 @@ import org.springframework.util.Assert;
|
|||
|
||||
/**
|
||||
* Simple implementation of the standard JDBC {@link javax.sql.DataSource} interface,
|
||||
* configuring a plain old JDBC {@link java.sql.Driver} via bean properties, and returning
|
||||
* a new {@link java.sql.Connection} from every {@code getConnection} call.
|
||||
* configuring a plain old JDBC {@link java.sql.Driver} via bean properties, and
|
||||
* returning a new {@link java.sql.Connection} from every {@code getConnection} call.
|
||||
*
|
||||
* <p><b>NOTE: This class is not an actual connection pool; it does not actually
|
||||
* pool Connections.</b> It just serves as simple replacement for a full-blown
|
||||
|
|
@ -40,7 +40,7 @@ import org.springframework.util.Assert;
|
|||
* for seamless switching to and from a local DataSource bean like this class.
|
||||
*
|
||||
* <p>If you need a "real" connection pool outside of a J2EE container, consider
|
||||
* <a href="http://jakarta.apache.org/commons/dbcp">Apache's Jakarta Commons DBCP</a>
|
||||
* <a href="http://commons.apache.org/proper/commons-dbcp">Apache Commons DBCP</a>
|
||||
* or <a href="http://sourceforge.net/projects/c3p0">C3P0</a>.
|
||||
* Commons DBCP's BasicDataSource and C3P0's ComboPooledDataSource are full
|
||||
* connection pool beans, supporting the same basic properties as this class
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -29,7 +29,7 @@ import org.springframework.util.ReflectionUtils;
|
|||
|
||||
/**
|
||||
* Implementation of the {@link NativeJdbcExtractor} interface for the
|
||||
* Jakarta Commons DBCP connection pool, version 1.1 or higher.
|
||||
* Apache Commons DBCP connection pool, version 1.1 or higher.
|
||||
*
|
||||
* <p>Returns the underlying native Connection, Statement, etc to application
|
||||
* code instead of DBCP's wrapper implementations. The returned JDBC classes
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -42,7 +42,7 @@ import java.sql.Statement;
|
|||
*
|
||||
* <p>When working with a simple connection pool that wraps Connections but not
|
||||
* Statements, a {@link SimpleNativeJdbcExtractor} is often sufficient. However,
|
||||
* some pools (like Jakarta's Commons DBCP) wrap <i>all</i> JDBC objects that they
|
||||
* some pools (like Apache's Commons DBCP) wrap <i>all</i> JDBC objects that they
|
||||
* return: Therefore, you need to use a specific {@code NativeJdbcExtractor}
|
||||
* (like {@link CommonsDbcpNativeJdbcExtractor}) with them.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
package org.springframework.jdbc.support.nativejdbc;
|
||||
|
||||
/**
|
||||
* Simple implementation of the {@link NativeJdbcExtractor} interface.
|
||||
* A simple implementation of the {@link NativeJdbcExtractor} interface.
|
||||
* Assumes a pool that wraps Connection handles but not DatabaseMetaData:
|
||||
* In this case, the underlying native Connection can be retrieved by simply
|
||||
* calling {@code conHandle.getMetaData().getConnection()}.
|
||||
|
|
@ -35,10 +35,9 @@ package org.springframework.jdbc.support.nativejdbc;
|
|||
* flags to "true". If none of the statement types is wrapped - or you solely need
|
||||
* Connection unwrapping in the first place -, the defaults are fine.
|
||||
*
|
||||
* <p>SimpleNativeJdbcExtractor is a common choice for use with OracleLobHandler,
|
||||
* which just needs Connection unwrapping via the
|
||||
* {@link #getNativeConnectionFromStatement} method. This usage will work
|
||||
* with almost any connection pool.
|
||||
* <p>SimpleNativeJdbcExtractor is a common choice for use with OracleLobHandler, which
|
||||
* just needs Connection unwrapping via the {@link #getNativeConnectionFromStatement}
|
||||
* method. This usage will work with almost any connection pool.
|
||||
*
|
||||
* <p>For full usage with JdbcTemplate, i.e. to also provide Statement unwrapping:
|
||||
* <ul>
|
||||
|
|
@ -47,8 +46,8 @@ package org.springframework.jdbc.support.nativejdbc;
|
|||
* <li>Use a SimpleNativeJdbcExtractor with all "nativeConnectionNecessaryForXxx"
|
||||
* flags set to "true" for C3P0 (all JDBC Statement objects are wrapped,
|
||||
* but none of the wrappers allow for unwrapping).
|
||||
* <li>Use a CommonsDbcpNativeJdbcExtractor for Jakarta Commons DBCP respectively
|
||||
* a JBossNativeJdbcExtractor for JBoss (all JDBC Statement objects are wrapped,
|
||||
* <li>Use a CommonsDbcpNativeJdbcExtractor for Apache Commons DBCP or a
|
||||
* JBossNativeJdbcExtractor for JBoss (all JDBC Statement objects are wrapped,
|
||||
* but all of them can be extracted by casting to implementation classes).
|
||||
* </ul>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -41,7 +41,7 @@ import org.springframework.util.ClassUtils;
|
|||
* <ul>
|
||||
* <li>{@code SingleConnectionDataSource} (using the same Connection for all getConnection calls)
|
||||
* <li>{@code DriverManagerDataSource} (creating a new Connection on each getConnection call)
|
||||
* <li>Apache's Jakarta Commons DBCP offers {@code org.apache.commons.dbcp.BasicDataSource} (a real pool)
|
||||
* <li>Apache's Commons DBCP offers {@code org.apache.commons.dbcp.BasicDataSource} (a real pool)
|
||||
* </ul>
|
||||
*
|
||||
* <p>Typical usage in bootstrap code:
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -22,14 +22,13 @@ import javax.servlet.jsp.PageContext;
|
|||
import org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager;
|
||||
|
||||
/**
|
||||
* Mock implementation of the JSP 2.0
|
||||
* {@link javax.servlet.jsp.el.ExpressionEvaluator} interface, delegating to the
|
||||
* Jakarta JSTL ExpressionEvaluatorManager.
|
||||
* <p>
|
||||
* Used for testing the web framework; only necessary for testing applications
|
||||
* Mock implementation of the JSP 2.0 {@link javax.servlet.jsp.el.ExpressionEvaluator}
|
||||
* interface, delegating to the Apache JSTL ExpressionEvaluatorManager.
|
||||
*
|
||||
* <p>Used for testing the web framework; only necessary for testing applications
|
||||
* when testing custom JSP tags.
|
||||
* <p>
|
||||
* Note that the Jakarta JSTL implementation (jstl.jar, standard.jar) has to be
|
||||
*
|
||||
* <p>Note that the Apache JSTL implementation (jstl.jar, standard.jar) has to be
|
||||
* available on the class path to use this expression evaluator.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
|
@ -44,20 +43,19 @@ public class MockExpressionEvaluator extends javax.servlet.jsp.el.ExpressionEval
|
|||
|
||||
/**
|
||||
* Create a new MockExpressionEvaluator for the given PageContext.
|
||||
*
|
||||
* @param pageContext the JSP PageContext to run in
|
||||
*/
|
||||
public MockExpressionEvaluator(PageContext pageContext) {
|
||||
this.pageContext = pageContext;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public javax.servlet.jsp.el.Expression parseExpression(final String expression, final Class expectedType,
|
||||
final javax.servlet.jsp.el.FunctionMapper functionMapper) throws javax.servlet.jsp.el.ELException {
|
||||
|
||||
return new javax.servlet.jsp.el.Expression() {
|
||||
|
||||
@Override
|
||||
public Object evaluate(javax.servlet.jsp.el.VariableResolver variableResolver) throws javax.servlet.jsp.el.ELException {
|
||||
return doEvaluate(expression, expectedType, functionMapper);
|
||||
|
|
|
|||
|
|
@ -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,10 @@ import org.springframework.remoting.support.RemoteInvocationResult;
|
|||
* <p>Two implementations are provided out of the box:
|
||||
* <ul>
|
||||
* <li><b>{@code SimpleHttpInvokerRequestExecutor}:</b>
|
||||
* Uses J2SE facilities to execute POST requests, without support
|
||||
* Uses JDK facilities to execute POST requests, without support
|
||||
* for HTTP authentication or advanced configuration options.
|
||||
* <li><b>{@code HttpComponentsHttpInvokerRequestExecutor}:</b>
|
||||
* Uses Jakarta's Commons HttpClient to execute POST requests,
|
||||
* Uses Apache's Commons HttpClient to execute POST requests,
|
||||
* allowing to use a preconfigured HttpClient instance
|
||||
* (potentially with authentication, HTTP connection pooling, etc).
|
||||
* </ul>
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -26,8 +26,10 @@ import javax.servlet.http.HttpServletRequest;
|
|||
*
|
||||
* <p>There are two concrete implementations included in Spring, as of Spring 3.1:
|
||||
* <ul>
|
||||
* <li>{@link org.springframework.web.multipart.commons.CommonsMultipartResolver} for Jakarta Commons FileUpload
|
||||
* <li>{@link org.springframework.web.multipart.support.StandardServletMultipartResolver} for Servlet 3.0 Part API
|
||||
* <li>{@link org.springframework.web.multipart.commons.CommonsMultipartResolver}
|
||||
* for Apache Commons FileUpload
|
||||
* <li>{@link org.springframework.web.multipart.support.StandardServletMultipartResolver}
|
||||
* for the Servlet 3.0+ Part API
|
||||
* </ul>
|
||||
*
|
||||
* <p>There is no default resolver implementation used for Spring
|
||||
|
|
@ -38,14 +40,11 @@ import javax.servlet.http.HttpServletRequest;
|
|||
* application context. Such a resolver gets applied to all requests handled
|
||||
* by that {@link org.springframework.web.servlet.DispatcherServlet}.
|
||||
*
|
||||
* <p>If a {@link org.springframework.web.servlet.DispatcherServlet} detects
|
||||
* a multipart request, it will resolve it via the configured
|
||||
* {@link MultipartResolver} and pass on a
|
||||
* wrapped {@link javax.servlet.http.HttpServletRequest}.
|
||||
* Controllers can then cast their given request to the
|
||||
* {@link MultipartHttpServletRequest}
|
||||
* interface, which permits access to any
|
||||
* {@link MultipartFile MultipartFiles}.
|
||||
* <p>If a {@link org.springframework.web.servlet.DispatcherServlet} detects a
|
||||
* multipart request, it will resolve it via the configured {@link MultipartResolver}
|
||||
* and pass on a wrapped {@link javax.servlet.http.HttpServletRequest}. Controllers
|
||||
* can then cast their given request to the {@link MultipartHttpServletRequest}
|
||||
* interface, which allows for access to any {@link MultipartFile MultipartFiles}.
|
||||
* Note that this cast is only supported in case of an actual multipart request.
|
||||
*
|
||||
* <pre class="code">
|
||||
|
|
@ -58,23 +57,19 @@ import javax.servlet.http.HttpServletRequest;
|
|||
* Instead of direct access, command or form controllers can register a
|
||||
* {@link org.springframework.web.multipart.support.ByteArrayMultipartFileEditor}
|
||||
* or {@link org.springframework.web.multipart.support.StringMultipartFileEditor}
|
||||
* with their data binder, to automatically apply multipart content to command
|
||||
* with their data binder, to automatically apply multipart content to form
|
||||
* bean properties.
|
||||
*
|
||||
* <p>As an alternative to using a
|
||||
* {@link MultipartResolver} with a
|
||||
* <p>As an alternative to using a {@link MultipartResolver} with a
|
||||
* {@link org.springframework.web.servlet.DispatcherServlet},
|
||||
* a {@link org.springframework.web.multipart.support.MultipartFilter} can be
|
||||
* registered in {@code web.xml}. It will delegate to a corresponding
|
||||
* {@link MultipartResolver} bean in the root
|
||||
* application context. This is mainly intended for applications that do not
|
||||
* use Spring's own web MVC framework.
|
||||
* {@link MultipartResolver} bean in the root application context. This is mainly
|
||||
* intended for applications that do not use Spring's own web MVC framework.
|
||||
*
|
||||
* <p>Note: There is hardly ever a need to access the
|
||||
* {@link MultipartResolver} itself
|
||||
* from application code. It will simply do its work behind the scenes,
|
||||
* making
|
||||
* {@link MultipartHttpServletRequest MultipartHttpServletRequests}
|
||||
* <p>Note: There is hardly ever a need to access the {@link MultipartResolver}
|
||||
* itself from application code. It will simply do its work behind the scenes,
|
||||
* making {@link MultipartHttpServletRequest MultipartHttpServletRequests}
|
||||
* available to controllers.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
|
@ -101,8 +96,8 @@ public interface MultipartResolver {
|
|||
/**
|
||||
* Parse the given HTTP request into multipart files and parameters,
|
||||
* and wrap the request inside a
|
||||
* {@link org.springframework.web.multipart.MultipartHttpServletRequest} object
|
||||
* that provides access to file descriptors and makes contained
|
||||
* {@link org.springframework.web.multipart.MultipartHttpServletRequest}
|
||||
* object that provides access to file descriptors and makes contained
|
||||
* parameters accessible via the standard ServletRequest methods.
|
||||
* @param request the servlet request to wrap (must be of a multipart content type)
|
||||
* @return the wrapped servlet request
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -39,7 +39,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
/**
|
||||
* Base class for multipart resolvers that use Jakarta Commons FileUpload
|
||||
* Base class for multipart resolvers that use Apache Commons FileUpload
|
||||
* 1.2 or above.
|
||||
*
|
||||
* <p>Provides common configuration properties and parsing functionality
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* MultipartFile implementation for Jakarta Commons FileUpload.
|
||||
* MultipartFile implementation for Apache Commons FileUpload.
|
||||
*
|
||||
* @author Trevor D. Cook
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -37,8 +37,8 @@ import org.springframework.web.multipart.support.DefaultMultipartHttpServletRequ
|
|||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
/**
|
||||
* Servlet-based {@link org.springframework.web.multipart.MultipartResolver} implementation
|
||||
* for <a href="http://jakarta.apache.org/commons/fileupload">Jakarta Commons FileUpload</a>
|
||||
* Servlet-based {@link MultipartResolver} implementation for
|
||||
* <a href="http://commons.apache.org/proper/commons-fileupload">Apache Commons FileUpload</a>
|
||||
* 1.2 or above.
|
||||
*
|
||||
* <p>Provides "maxUploadSize", "maxInMemorySize" and "defaultEncoding" settings as
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* MultipartResolver implementation for
|
||||
* <a href="http://jakarta.apache.org/commons/fileupload">Jakarta Commons FileUpload</a>.
|
||||
* <a href="http://commons.apache.org/proper/commons-fileupload">Apache Commons FileUpload</a>.
|
||||
*/
|
||||
package org.springframework.web.multipart.commons;
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -27,7 +27,7 @@ import org.springframework.util.Assert;
|
|||
* <a href="http://www.w3.org/TR/html4/charset.html">http://www.w3.org/TR/html4/charset.html</a>
|
||||
*
|
||||
* <p>For a comprehensive set of String escaping utilities,
|
||||
* consider Jakarta Commons Lang and its StringEscapeUtils class.
|
||||
* consider Apache Commons Lang and its StringEscapeUtils class.
|
||||
* We are not using that class here to avoid a runtime dependency
|
||||
* on Commons Lang just for HTML escaping. Furthermore, Spring's
|
||||
* HTML escaping is more flexible and 100% HTML 4.0 compliant.
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class UriComponentsBuilder implements Cloneable {
|
|||
// Factory methods
|
||||
|
||||
/**
|
||||
* Returns a new, empty builder.
|
||||
* Create a new, empty builder.
|
||||
* @return the new {@code UriComponentsBuilder}
|
||||
*/
|
||||
public static UriComponentsBuilder newInstance() {
|
||||
|
|
@ -143,7 +143,7 @@ public class UriComponentsBuilder implements Cloneable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a builder that is initialized with the given path.
|
||||
* Create a builder that is initialized with the given path.
|
||||
* @param path the path to initialize with
|
||||
* @return the new {@code UriComponentsBuilder}
|
||||
*/
|
||||
|
|
@ -154,7 +154,7 @@ public class UriComponentsBuilder implements Cloneable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a builder that is initialized with the given {@code URI}.
|
||||
* Create a builder that is initialized with the given {@code URI}.
|
||||
* @param uri the URI to initialize with
|
||||
* @return the new {@code UriComponentsBuilder}
|
||||
*/
|
||||
|
|
@ -165,7 +165,7 @@ public class UriComponentsBuilder implements Cloneable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a builder that is initialized with the given URI string.
|
||||
* Create a builder that is initialized with the given URI string.
|
||||
* <p><strong>Note:</strong> The presence of reserved characters can prevent
|
||||
* correct parsing of the URI string. For example if a query parameter
|
||||
* contains {@code '='} or {@code '&'} characters, the query string cannot
|
||||
|
|
@ -225,7 +225,7 @@ public class UriComponentsBuilder implements Cloneable {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new {@code UriComponents} object from the string HTTP URL.
|
||||
* Create a URI components builder from the given HTTP URL String.
|
||||
* <p><strong>Note:</strong> The presence of reserved characters can prevent
|
||||
* correct parsing of the URI string. For example if a query parameter
|
||||
* contains {@code '='} or {@code '&'} characters, the query string cannot
|
||||
|
|
@ -286,7 +286,7 @@ public class UriComponentsBuilder implements Cloneable {
|
|||
String hostToUse = hosts[0];
|
||||
if (hostToUse.contains(":")) {
|
||||
String[] hostAndPort = StringUtils.split(hostToUse, ":");
|
||||
host = hostAndPort[0];
|
||||
host = hostAndPort[0];
|
||||
port = Integer.parseInt(hostAndPort[1]);
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -66,9 +66,8 @@ import org.springframework.web.servlet.ViewResolver;
|
|||
* controllers. Dispatches to registered handlers for processing a portlet request.
|
||||
*
|
||||
* <p>This portlet is very flexible: It can be used with just about any workflow,
|
||||
* with the installation of the appropriate adapter classes. It offers the
|
||||
* following functionality that distinguishes it from other request-driven
|
||||
* portlet MVC frameworks:
|
||||
* with the installation of the appropriate adapter classes. It offers the following
|
||||
* functionality that distinguishes it from other request-driven Portlet MVC frameworks:
|
||||
*
|
||||
* <ul>
|
||||
* <li>It is based around a JavaBeans configuration mechanism.
|
||||
|
|
@ -77,8 +76,8 @@ import org.springframework.web.servlet.ViewResolver;
|
|||
* as part of an application - to control the routing of requests to handler objects.
|
||||
* Default is a {@link org.springframework.web.portlet.mvc.annotation.DefaultAnnotationHandlerMapping}.
|
||||
* HandlerMapping objects can be defined as beans in the portlet's application context,
|
||||
* implementing the HandlerMapping interface, overriding the default HandlerMapping if present.
|
||||
* HandlerMappings can be given any bean name (they are tested by type).
|
||||
* implementing the HandlerMapping interface, overriding the default HandlerMapping
|
||||
* if present. HandlerMappings can be given any bean name (they are tested by type).
|
||||
*
|
||||
* <li>It can use any {@link HandlerAdapter}; this allows for using any handler interface.
|
||||
* The default adapter is {@link org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter}
|
||||
|
|
@ -102,27 +101,24 @@ import org.springframework.web.servlet.ViewResolver;
|
|||
* (they are tested by type).
|
||||
*
|
||||
* <li>The dispatcher's strategy for resolving multipart requests is determined by a
|
||||
* {@link org.springframework.web.portlet.multipart.PortletMultipartResolver} implementation.
|
||||
* An implementations for Jakarta Commons FileUpload is included:
|
||||
* {@link org.springframework.web.portlet.multipart.PortletMultipartResolver}
|
||||
* implementation. An implementations for Apache Commons FileUpload is included:
|
||||
* {@link org.springframework.web.portlet.multipart.CommonsPortletMultipartResolver}.
|
||||
* The MultipartResolver bean name is "portletMultipartResolver"; default is none.
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>NOTE: The {@code @RequestMapping} annotation will only be processed
|
||||
* if a corresponding {@code HandlerMapping} (for type level annotations)
|
||||
* and/or {@code HandlerAdapter} (for method level annotations)
|
||||
* is present in the dispatcher.</b> This is the case by default.
|
||||
* However, if you are defining custom {@code HandlerMappings} or
|
||||
* {@code HandlerAdapters}, then you need to make sure that a
|
||||
* corresponding custom {@code DefaultAnnotationHandlerMapping}
|
||||
* and/or {@code AnnotationMethodHandlerAdapter} is defined as well
|
||||
* - provided that you intend to use {@code @RequestMapping}.
|
||||
* <p><b>NOTE: The {@code @RequestMapping} annotation will only be processed if a
|
||||
* corresponding {@code HandlerMapping} (for type-level annotations) and/or
|
||||
* {@code HandlerAdapter} (for method-level annotations) is present in the dispatcher.</b>
|
||||
* This is the case by default. However, if you are defining custom {@code HandlerMappings}
|
||||
* or {@code HandlerAdapters}, then you need to make sure that a corresponding custom
|
||||
* {@code DefaultAnnotationHandlerMapping} and/or {@code AnnotationMethodHandlerAdapter}
|
||||
* is defined as well - provided that you intend to use {@code @RequestMapping}.
|
||||
*
|
||||
* <p><b>A web application can define any number of DispatcherPortlets.</b>
|
||||
* Each portlet will operate in its own namespace, loading its own application
|
||||
* context with mappings, handlers, etc. Only the root application context
|
||||
* as loaded by {@link org.springframework.web.context.ContextLoaderListener},
|
||||
* if any, will be shared.
|
||||
* Each portlet will operate in its own namespace, loading its own application context
|
||||
* with mappings, handlers, etc. Only the root application context as loaded by
|
||||
* {@link org.springframework.web.context.ContextLoaderListener}, if any, will be shared.
|
||||
*
|
||||
* <p>Thanks to Rainer Schmitz, Nick Lothian and Eric Dalquist for their suggestions!
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -36,7 +36,7 @@ import org.springframework.web.portlet.util.PortletUtils;
|
|||
|
||||
/**
|
||||
* {@link PortletMultipartResolver} implementation for
|
||||
* <a href="http://jakarta.apache.org/commons/fileupload">Jakarta Commons FileUpload</a>
|
||||
* <a href="http://commons.apache.org/proper/commons-fileupload">Apache Commons FileUpload</a>
|
||||
* 1.2 or above.
|
||||
*
|
||||
* <p>Provides "maxUploadSize", "maxInMemorySize" and "defaultEncoding" settings as
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -30,25 +30,23 @@ import org.springframework.web.multipart.MultipartException;
|
|||
* <p>There is one concrete implementation included in Spring:
|
||||
* <ul>
|
||||
* <li>{@link org.springframework.web.multipart.commons.CommonsMultipartResolver}
|
||||
* for Jakarta Commons FileUpload
|
||||
* for Apache Commons FileUpload
|
||||
* </ul>
|
||||
*
|
||||
* <p>There is no default resolver implementation used for Spring
|
||||
* {@link org.springframework.web.portlet.DispatcherPortlet DispatcherPortlets},
|
||||
* as an application might choose to parse its multipart requests itself. To
|
||||
* define an implementation, create a bean with the id
|
||||
* {@link org.springframework.web.portlet.DispatcherPortlet#MULTIPART_RESOLVER_BEAN_NAME "portletMultipartResolver"}
|
||||
* define an implementation, create a bean with the id "portletMultipartResolver"
|
||||
* in a {@code DispatcherPortlet's} application context. Such a resolver
|
||||
* gets applied to all requests handled by that {@code DispatcherPortlet}.
|
||||
*
|
||||
* <p>If a {@code DispatcherPortlet} detects a multipart request, it will
|
||||
* resolve it via the configured
|
||||
* {@link org.springframework.web.multipart.MultipartResolver} and pass on a
|
||||
* wrapped Portlet {@link ActionRequest}.
|
||||
* {@link org.springframework.web.portlet.mvc.Controller Controllers} can then
|
||||
* {@link org.springframework.web.portlet.multipart.PortletMultipartResolver}
|
||||
* and pass on a wrapped Portlet {@link ActionRequest}. Controllers can then
|
||||
* cast their given request to the {@link MultipartActionRequest} interface,
|
||||
* being able to access {@code MultipartFiles}. Note that this cast is
|
||||
* only supported in case of an actual multipart request.
|
||||
* being able to access {@code MultipartFiles}. Note that this cast is only
|
||||
* supported in case of an actual multipart request.
|
||||
*
|
||||
* <pre class="code"> public void handleActionRequest(ActionRequest request, ActionResponse response) {
|
||||
* MultipartActionRequest multipartRequest = (MultipartActionRequest) request;
|
||||
|
|
@ -59,13 +57,12 @@ import org.springframework.web.multipart.MultipartException;
|
|||
* Instead of direct access, command or form controllers can register a
|
||||
* {@link org.springframework.web.multipart.support.ByteArrayMultipartFileEditor}
|
||||
* or {@link org.springframework.web.multipart.support.StringMultipartFileEditor}
|
||||
* with their data binder, to automatically apply multipart content to command
|
||||
* with their data binder, to automatically apply multipart content to form
|
||||
* bean properties.
|
||||
*
|
||||
* <p>Note: There is hardly ever a need to access the
|
||||
* {@code MultipartResolver} itself from application code. It will simply
|
||||
* do its work behind the scenes, making {@code MultipartActionRequests}
|
||||
* available to controllers.
|
||||
* <p>Note: There is hardly ever a need to access the {@code MultipartResolver}
|
||||
* itself from application code. It will simply do its work behind the scenes,
|
||||
* making {@code MultipartActionRequests} available to controllers.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 2.0
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -60,73 +60,89 @@ import org.springframework.web.util.NestedServletException;
|
|||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
/**
|
||||
* Central dispatcher for HTTP request handlers/controllers, e.g. for web UI controllers or HTTP-based remote service
|
||||
* exporters. Dispatches to registered handlers for processing a web request, providing convenient mapping and exception
|
||||
* handling facilities.
|
||||
* Central dispatcher for HTTP request handlers/controllers, e.g. for web UI controllers
|
||||
* or HTTP-based remote service exporters. Dispatches to registered handlers for processing
|
||||
* a web request, providing convenient mapping and exception handling facilities.
|
||||
*
|
||||
* <p>This servlet is very flexible: It can be used with just about any workflow, with the installation of the
|
||||
* appropriate adapter classes. It offers the following functionality that distinguishes it from other request-driven
|
||||
* web MVC frameworks:
|
||||
* <p>This servlet is very flexible: It can be used with just about any workflow, with the
|
||||
* installation of the appropriate adapter classes. It offers the following functionality
|
||||
* that distinguishes it from other request-driven web MVC frameworks:
|
||||
*
|
||||
* <ul> <li>It is based around a JavaBeans configuration mechanism.
|
||||
* <ul>
|
||||
* <li>It is based around a JavaBeans configuration mechanism.
|
||||
*
|
||||
* <li>It can use any {@link HandlerMapping} implementation - pre-built or provided as part of an application - to
|
||||
* control the routing of requests to handler objects. Default is {@link org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping}
|
||||
* and {@link org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping}. HandlerMapping objects
|
||||
* can be defined as beans in the servlet's application context, implementing the HandlerMapping interface, overriding
|
||||
* the default HandlerMapping if present. HandlerMappings can be given any bean name (they are tested by type).
|
||||
* <li>It can use any {@link HandlerMapping} implementation - pre-built or provided as part
|
||||
* of an application - to control the routing of requests to handler objects. Default is
|
||||
* {@link org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping} and
|
||||
* {@link org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping}.
|
||||
* HandlerMapping objects can be defined as beans in the servlet's application context,
|
||||
* implementing the HandlerMapping interface, overriding the default HandlerMapping if
|
||||
* present. HandlerMappings can be given any bean name (they are tested by type).
|
||||
*
|
||||
* <li>It can use any {@link HandlerAdapter}; this allows for using any handler interface. Default adapters are {@link
|
||||
* org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter}, {@link org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter},
|
||||
* for Spring's {@link org.springframework.web.HttpRequestHandler} and {@link org.springframework.web.servlet.mvc.Controller}
|
||||
* interfaces, respectively. A default {@link org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter}
|
||||
* will be registered as well. HandlerAdapter objects can be added as beans in the application context, overriding the
|
||||
* default HandlerAdapters. Like HandlerMappings, HandlerAdapters can be given any bean name (they are tested by type).
|
||||
* <li>It can use any {@link HandlerAdapter}; this allows for using any handler interface.
|
||||
* Default adapters are {@link org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter},
|
||||
* {@link org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter}, for Spring's
|
||||
* {@link org.springframework.web.HttpRequestHandler} and
|
||||
* {@link org.springframework.web.servlet.mvc.Controller} interfaces, respectively. A default
|
||||
* {@link org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter}
|
||||
* will be registered as well. HandlerAdapter objects can be added as beans in the
|
||||
* application context, overriding the default HandlerAdapters. Like HandlerMappings,
|
||||
* HandlerAdapters can be given any bean name (they are tested by type).
|
||||
*
|
||||
* <li>The dispatcher's exception resolution strategy can be specified via a {@link HandlerExceptionResolver}, for
|
||||
* example mapping certain exceptions to error pages. Default are
|
||||
* <li>The dispatcher's exception resolution strategy can be specified via a
|
||||
* {@link HandlerExceptionResolver}, for example mapping certain exceptions to error pages.
|
||||
* Default are
|
||||
* {@link org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver},
|
||||
* {@link org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver}, and
|
||||
* {@link org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver}. These HandlerExceptionResolvers can be overridden
|
||||
* through the application context. HandlerExceptionResolver can be given any bean name (they are tested by type).
|
||||
* {@link org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver}.
|
||||
* These HandlerExceptionResolvers can be overridden through the application context.
|
||||
* HandlerExceptionResolver can be given any bean name (they are tested by type).
|
||||
*
|
||||
* <li>Its view resolution strategy can be specified via a {@link ViewResolver} implementation, resolving symbolic view
|
||||
* names into View objects. Default is {@link org.springframework.web.servlet.view.InternalResourceViewResolver}.
|
||||
* ViewResolver objects can be added as beans in the application context, overriding the default ViewResolver.
|
||||
* ViewResolvers can be given any bean name (they are tested by type).
|
||||
* <li>Its view resolution strategy can be specified via a {@link ViewResolver}
|
||||
* implementation, resolving symbolic view names into View objects. Default is
|
||||
* {@link org.springframework.web.servlet.view.InternalResourceViewResolver}.
|
||||
* ViewResolver objects can be added as beans in the application context, overriding the
|
||||
* default ViewResolver. ViewResolvers can be given any bean name (they are tested by type).
|
||||
*
|
||||
* <li>If a {@link View} or view name is not supplied by the user, then the configured {@link
|
||||
* RequestToViewNameTranslator} will translate the current request into a view name. The corresponding bean name is
|
||||
* "viewNameTranslator"; the default is {@link org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator}.
|
||||
* <li>If a {@link View} or view name is not supplied by the user, then the configured
|
||||
* {@link RequestToViewNameTranslator} will translate the current request into a view name.
|
||||
* The corresponding bean name is "viewNameTranslator"; the default is
|
||||
* {@link org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator}.
|
||||
*
|
||||
* <li>The dispatcher's strategy for resolving multipart requests is determined by a {@link
|
||||
* org.springframework.web.multipart.MultipartResolver} implementation. Implementations for Jakarta Commons FileUpload
|
||||
* and Jason Hunter's COS are included; the typical choise is {@link org.springframework.web.multipart.commons.CommonsMultipartResolver}.
|
||||
* <li>The dispatcher's strategy for resolving multipart requests is determined by a
|
||||
* {@link org.springframework.web.multipart.MultipartResolver} implementation.
|
||||
* Implementations for Apache Commons FileUpload and Servlet 3 are included; the typical
|
||||
* choice is {@link org.springframework.web.multipart.commons.CommonsMultipartResolver}.
|
||||
* The MultipartResolver bean name is "multipartResolver"; default is none.
|
||||
*
|
||||
* <li>Its locale resolution strategy is determined by a {@link LocaleResolver}. Out-of-the-box implementations work via
|
||||
* HTTP accept header, cookie, or session. The LocaleResolver bean name is "localeResolver"; default is {@link
|
||||
* org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver}.
|
||||
* <li>Its locale resolution strategy is determined by a {@link LocaleResolver}.
|
||||
* Out-of-the-box implementations work via HTTP accept header, cookie, or session.
|
||||
* The LocaleResolver bean name is "localeResolver"; default is
|
||||
* {@link org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver}.
|
||||
*
|
||||
* <li>Its theme resolution strategy is determined by a {@link ThemeResolver}. Implementations for a fixed theme and for
|
||||
* cookie and session storage are included. The ThemeResolver bean name is "themeResolver"; default is {@link
|
||||
* org.springframework.web.servlet.theme.FixedThemeResolver}. </ul>
|
||||
* <li>Its theme resolution strategy is determined by a {@link ThemeResolver}.
|
||||
* Implementations for a fixed theme and for cookie and session storage are included.
|
||||
* The ThemeResolver bean name is "themeResolver"; default is
|
||||
* {@link org.springframework.web.servlet.theme.FixedThemeResolver}.
|
||||
* </ul>
|
||||
*
|
||||
* <p><b>NOTE: The {@code @RequestMapping} annotation will only be processed if a corresponding
|
||||
* {@code HandlerMapping} (for type level annotations) and/or {@code HandlerAdapter} (for method level
|
||||
* annotations) is present in the dispatcher.</b> This is the case by default. However, if you are defining custom
|
||||
* {@code HandlerMappings} or {@code HandlerAdapters}, then you need to make sure that a corresponding custom
|
||||
* {@code DefaultAnnotationHandlerMapping} and/or {@code AnnotationMethodHandlerAdapter} is defined as well -
|
||||
* provided that you intend to use {@code @RequestMapping}.
|
||||
* <p><b>NOTE: The {@code @RequestMapping} annotation will only be processed if a
|
||||
* corresponding {@code HandlerMapping} (for type-level annotations) and/or
|
||||
* {@code HandlerAdapter} (for method-level annotations) is present in the dispatcher.</b>
|
||||
* This is the case by default. However, if you are defining custom {@code HandlerMappings}
|
||||
* or {@code HandlerAdapters}, then you need to make sure that a corresponding custom
|
||||
* {@code DefaultAnnotationHandlerMapping} and/or {@code AnnotationMethodHandlerAdapter}
|
||||
* is defined as well - provided that you intend to use {@code @RequestMapping}.
|
||||
*
|
||||
* <p><b>A web application can define any number of DispatcherServlets.</b> Each servlet will operate in its own
|
||||
* namespace, loading its own application context with mappings, handlers, etc. Only the root application context as
|
||||
* loaded by {@link org.springframework.web.context.ContextLoaderListener}, if any, will be shared.
|
||||
* <p><b>A web application can define any number of DispatcherServlets.</b>
|
||||
* Each servlet will operate in its own namespace, loading its own application context
|
||||
* with mappings, handlers, etc. Only the root application context as loaded by
|
||||
* {@link org.springframework.web.context.ContextLoaderListener}, if any, will be shared.
|
||||
*
|
||||
* <p>As of Spring 3.1, {@code DispatcherServlet} may now be injected with a web
|
||||
* application context, rather than creating its own internally. This is useful in Servlet
|
||||
* 3.0+ environments, which support programmatic registration of servlet instances. See
|
||||
* {@link #DispatcherServlet(WebApplicationContext)} Javadoc for details.
|
||||
* 3.0+ environments, which support programmatic registration of servlet instances.
|
||||
* See the {@link #DispatcherServlet(WebApplicationContext)} javadoc for details.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -258,7 +258,7 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce
|
|||
}
|
||||
|
||||
List<ControllerAdviceBean> adviceBeans = ControllerAdviceBean.findAnnotatedBeans(getApplicationContext());
|
||||
Collections.sort(adviceBeans, new OrderComparator());
|
||||
OrderComparator.sort(adviceBeans);
|
||||
|
||||
for (ControllerAdviceBean adviceBean : adviceBeans) {
|
||||
ExceptionHandlerMethodResolver resolver = new ExceptionHandlerMethodResolver(adviceBean.getBeanType());
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -18,7 +18,6 @@ package org.springframework.web.servlet.mvc.method.annotation;
|
|||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -519,7 +518,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
|
|||
}
|
||||
|
||||
List<ControllerAdviceBean> beans = ControllerAdviceBean.findAnnotatedBeans(getApplicationContext());
|
||||
Collections.sort(beans, new OrderComparator());
|
||||
OrderComparator.sort(beans);
|
||||
|
||||
List<Object> responseBodyAdviceBeans = new ArrayList<Object>();
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ public class ResourceUrlProvider implements ApplicationListener<ContextRefreshed
|
|||
|
||||
Map<String, SimpleUrlHandlerMapping> map = appContext.getBeansOfType(SimpleUrlHandlerMapping.class);
|
||||
List<SimpleUrlHandlerMapping> handlerMappings = new ArrayList<SimpleUrlHandlerMapping>(map.values());
|
||||
Collections.sort(handlerMappings, new OrderComparator());
|
||||
OrderComparator.sort(handlerMappings);
|
||||
|
||||
for (SimpleUrlHandlerMapping hm : handlerMappings) {
|
||||
for (String pattern : hm.getHandlerMap().keySet()) {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -55,29 +55,31 @@ import org.springframework.web.servlet.View;
|
|||
import org.springframework.web.servlet.ViewResolver;
|
||||
|
||||
/**
|
||||
* Implementation of {@link ViewResolver} that resolves a view based on the request file name or {@code Accept} header.
|
||||
* Implementation of {@link ViewResolver} that resolves a view based on the request file name
|
||||
* or {@code Accept} header.
|
||||
*
|
||||
* <p>The {@code ContentNegotiatingViewResolver} does not resolve views itself, but delegates to other {@link
|
||||
* ViewResolver}s. By default, these other view resolvers are picked up automatically from the application context,
|
||||
* though they can also be set explicitly by using the {@link #setViewResolvers(List) viewResolvers} property.
|
||||
* <strong>Note</strong> that in order for this view resolver to work properly, the {@link #setOrder(int) order}
|
||||
* property needs to be set to a higher precedence than the others (the default is {@link Ordered#HIGHEST_PRECEDENCE}.)
|
||||
* <p>The {@code ContentNegotiatingViewResolver} does not resolve views itself, but delegates to
|
||||
* other {@link ViewResolver}s. By default, these other view resolvers are picked up automatically
|
||||
* from the application context, though they can also be set explicitly by using the
|
||||
* {@link #setViewResolvers viewResolvers} property. <strong>Note</strong> that in order for this
|
||||
* view resolver to work properly, the {@link #setOrder order} property needs to be set to a higher
|
||||
* precedence than the others (the default is {@link Ordered#HIGHEST_PRECEDENCE}).
|
||||
*
|
||||
* <p>This view resolver uses the requested {@linkplain MediaType media type} to select a suitable {@link View} for a
|
||||
* request. The requested media type is determined through the configured {@link ContentNegotiationManager}.
|
||||
* Once the requested media type has been determined, this resolver queries each delegate view resolver for a
|
||||
* {@link View} and determines if the requested media type is {@linkplain MediaType#includes(MediaType) compatible}
|
||||
* with the view's {@linkplain View#getContentType() content type}). The most compatible view is returned.
|
||||
* <p>This view resolver uses the requested {@linkplain MediaType media type} to select a suitable
|
||||
* {@link View} for a request. The requested media type is determined through the configured
|
||||
* {@link ContentNegotiationManager}. Once the requested media type has been determined, this resolver
|
||||
* queries each delegate view resolver for a {@link View} and determines if the requested media type
|
||||
* is {@linkplain MediaType#includes(MediaType) compatible} with the view's
|
||||
* {@linkplain View#getContentType() content type}). The most compatible view is returned.
|
||||
*
|
||||
* <p>Additionally, this view resolver exposes the {@link #setDefaultViews(List) defaultViews} property, allowing you to
|
||||
* override the views provided by the view resolvers. Note that these default views are offered as candidates, and
|
||||
* still need have the content type requested (via file extension, parameter, or {@code Accept} header, described above).
|
||||
* You can also set the {@linkplain #setDefaultContentType(MediaType) default content type} directly, which will be
|
||||
* returned when the other mechanisms ({@code Accept} header, file extension or parameter) do not result in a match.
|
||||
* <p>Additionally, this view resolver exposes the {@link #setDefaultViews(List) defaultViews} property,
|
||||
* allowing you to override the views provided by the view resolvers. Note that these default views are
|
||||
* offered as candidates, and still need have the content type requested (via file extension, parameter,
|
||||
* or {@code Accept} header, described above).
|
||||
*
|
||||
* <p>For example, if the request path is {@code /view.html}, this view resolver will look for a view that has the
|
||||
* {@code text/html} content type (based on the {@code html} file extension). A request for {@code /view} with a {@code
|
||||
* text/html} request {@code Accept} header has the same result.
|
||||
* <p>For example, if the request path is {@code /view.html}, this view resolver will look for a view
|
||||
* that has the {@code text/html} content type (based on the {@code html} file extension). A request
|
||||
* for {@code /view} with a {@code text/html} request {@code Accept} header has the same result.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Juergen Hoeller
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
@ -51,7 +51,7 @@ import org.springframework.web.servlet.view.AbstractView;
|
|||
* </ul>
|
||||
*
|
||||
* <p>For working with the workbook in the subclass, see
|
||||
* <a href="http://jakarta.apache.org/poi/index.html">Jakarta's POI site</a>
|
||||
* <a href="http://poi.apache.org">Apache's POI site</a>
|
||||
*
|
||||
* <p>As an example, you can try this snippet:
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue