Removed outdated references to Servlet 2.3/2.4

(cherry picked from commit 673dac5)
This commit is contained in:
Juergen Hoeller 2015-03-24 21:21:18 +01:00
parent 209e8de188
commit c8cc8b7cbd
15 changed files with 76 additions and 51 deletions

View File

@ -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.
@ -38,7 +38,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.filter.OncePerRequestFilter;
/**
* Servlet 2.3 Filter that binds a Hibernate Session to the thread for the entire
* Servlet Filter that binds a Hibernate Session to the thread for the entire
* processing of the request. Intended for the "Open Session in View" pattern,
* i.e. to allow for lazy loading in web views despite the original transactions
* already being completed.
@ -98,6 +98,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
return this.sessionFactoryBeanName;
}
/**
* Returns "false" so that the filter may re-bind the opened Hibernate
* {@code Session} to each asynchronously dispatched thread and postpone

View File

@ -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.
@ -38,7 +38,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.filter.OncePerRequestFilter;
/**
* Servlet 2.3 Filter that binds a Hibernate Session to the thread for the entire
* Servlet Filter that binds a Hibernate Session to the thread for the entire
* processing of the request. Intended for the "Open Session in View" pattern,
* i.e. to allow for lazy loading in web views despite the original transactions
* already being completed.
@ -164,6 +164,7 @@ public class OpenSessionInViewFilter extends OncePerRequestFilter {
return this.flushMode;
}
/**
* Returns "false" so that the filter may re-bind the opened Hibernate
* {@code Session} to each asynchronously dispatched thread and postpone

View File

@ -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.
@ -32,7 +32,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.filter.OncePerRequestFilter;
/**
* Servlet 2.3 Filter that binds a JDO PersistenceManager to the thread for the
* Servlet Filter that binds a JDO PersistenceManager to the thread for the
* entire processing of the request. Intended for the "Open PersistenceManager in
* View" pattern, i.e. to allow for lazy loading in web views despite the
* original transactions already being completed.
@ -79,6 +79,25 @@ public class OpenPersistenceManagerInViewFilter extends OncePerRequestFilter {
}
/**
* Returns "false" so that the filter may re-bind the opened {@code PersistenceManager}
* to each asynchronously dispatched thread and postpone closing it until the very
* last asynchronous dispatch.
*/
@Override
protected boolean shouldNotFilterAsyncDispatch() {
return false;
}
/**
* Returns "false" so that the filter may provide an {@code PersistenceManager}
* to each error dispatches.
*/
@Override
protected boolean shouldNotFilterErrorDispatch() {
return false;
}
@Override
protected void doFilterInternal(
HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)

View File

@ -37,7 +37,7 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.filter.OncePerRequestFilter;
/**
* Servlet 2.3 Filter that binds a JPA EntityManager to the thread for the
* Servlet Filter that binds a JPA EntityManager to the thread for the
* entire processing of the request. Intended for the "Open EntityManager in
* View" pattern, i.e. to allow for lazy loading in web views despite the
* original transactions already being completed.
@ -122,9 +122,9 @@ public class OpenEntityManagerInViewFilter extends OncePerRequestFilter {
/**
* Returns "false" so that the filter may re-bind the opened
* {@code EntityManager} to each asynchronously dispatched thread and postpone
* closing it until the very last asynchronous dispatch.
* Returns "false" so that the filter may re-bind the opened {@code EntityManager}
* to each asynchronously dispatched thread and postpone closing it until the very
* last asynchronous dispatch.
*/
@Override
protected boolean shouldNotFilterAsyncDispatch() {

View File

@ -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.
@ -21,8 +21,8 @@ import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
/**
* Adapter that implements the Servlet 2.3 HttpSessionBindingListener
* interface, wrapping a session destruction callback.
* Adapter that implements the Servlet HttpSessionBindingListener interface,
* wrapping a session destruction callback.
*
* @author Juergen Hoeller
* @since 3.0

View File

@ -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,7 +23,7 @@ import javax.servlet.http.HttpServletRequest;
import org.springframework.context.i18n.LocaleContextHolder;
/**
* Servlet 2.4+ listener that exposes the request to the current thread,
* Servlet listener that exposes the request to the current thread,
* through both {@link org.springframework.context.i18n.LocaleContextHolder} and
* {@link RequestContextHolder}. To be registered as listener in {@code web.xml}.
*

View File

@ -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.StringUtils;
/**
* ServletContext-aware subclass of {@link PathMatchingResourcePatternResolver},
* able to find matching resources below the web application root directory
* via Servlet 2.3's {@code ServletContext.getResourcePaths}.
* Falls back to the superclass' file system checking for other resources.
* via {@link ServletContext#getResourcePaths}. Falls back to the superclass'
* file system checking for other resources.
*
* @author Juergen Hoeller
* @since 1.1.2

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 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,15 +23,15 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet 2.3/2.4 Filter that allows one to specify a character encoding for
* requests. This is useful because current browsers typically do not set a
* character encoding even if specified in the HTML page or form.
* Servlet Filter that allows one to specify a character encoding for requests.
* This is useful because current browsers typically do not set a character
* encoding even if specified in the HTML page or form.
*
* <p>This filter can either apply its encoding if the request does not
* already specify an encoding, or enforce this filter's encoding in any case
* <p>This filter can either apply its encoding if the request does not already
* specify an encoding, or enforce this filter's encoding in any case
* ("forceEncoding"="true"). In the latter case, the encoding will also be
* applied as default response encoding on Servlet 2.4+ containers (although
* this will usually be overridden by a full content type set in the view).
* applied as default response encoding (although this will usually be overridden
* by a full content type set in the view).
*
* @author Juergen Hoeller
* @since 15.03.2004
@ -65,9 +65,6 @@ public class CharacterEncodingFilter extends OncePerRequestFilter {
* {@link javax.servlet.http.HttpServletRequest#getCharacterEncoding()}
* returns a non-null value. Switch this to "true" to enforce the specified
* encoding in any case, applying it as default response encoding as well.
* <p>Note that the response encoding will only be set on Servlet 2.4+
* containers, since Servlet 2.3 did not provide a facility for setting
* a default response encoding.
*/
public void setForceEncoding(boolean forceEncoding) {
this.forceEncoding = forceEncoding;

View File

@ -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.
@ -29,16 +29,16 @@ import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
/**
* Proxy for a standard Servlet 2.3 Filter, delegating to a Spring-managed
* bean that implements the Filter interface. Supports a "targetBeanName"
* filter init-param in {@code web.xml}, specifying the name of the
* target bean in the Spring application context.
* Proxy for a standard Servlet Filter, delegating to a Spring-managed bean that
* implements the Filter interface. Supports a "targetBeanName" filter init-param
* in {@code web.xml}, specifying the name of the target bean in the Spring
* application context.
*
* <p>{@code web.xml} will usually contain a {@code DelegatingFilterProxy} definition,
* with the specified {@code filter-name} corresponding to a bean name in
* Spring's root application context. All calls to the filter proxy will then
* be delegated to that bean in the Spring context, which is required to implement
* the standard Servlet 2.3 Filter interface.
* the standard Servlet Filter interface.
*
* <p>This approach is particularly useful for Filter implementation with complex
* setup needs, allowing to apply the full Spring bean definition machinery to
@ -183,7 +183,7 @@ public class DelegatingFilterProxy extends GenericFilterBean {
/**
* Set the name of the target bean in the Spring application context.
* The target bean must implement the standard Servlet 2.3 Filter interface.
* The target bean must implement the standard Servlet Filter interface.
* <p>By default, the {@code filter-name} as specified for the
* DelegatingFilterProxy in {@code web.xml} will be used.
*/

View File

@ -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.
@ -113,11 +113,12 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
}
}
private boolean skipDispatch(HttpServletRequest request) {
if (isAsyncDispatch(request) && shouldNotFilterAsyncDispatch()) {
return true;
}
if ((request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE) != null) && shouldNotFilterErrorDispatch()) {
if (request.getAttribute(WebUtils.ERROR_REQUEST_URI_ATTRIBUTE) != null && shouldNotFilterErrorDispatch()) {
return true;
}
return false;
@ -129,6 +130,7 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
* the course of a single request. This method returns {@code true} if the
* filter is currently executing within an asynchronous dispatch.
* @param request the current request
* @since 3.2
* @see WebAsyncManager#hasConcurrentResult()
*/
protected boolean isAsyncDispatch(HttpServletRequest request) {
@ -139,6 +141,7 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
* Whether request processing is in asynchronous mode meaning that the
* response will not be committed after the current thread is exited.
* @param request the current request
* @since 3.2
* @see WebAsyncManager#isConcurrentHandlingStarted()
*/
protected boolean isAsyncStarted(HttpServletRequest request) {
@ -189,6 +192,7 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
* invoked during subsequent async dispatches. If "false", the filter will
* be invoked during async dispatches with the same guarantees of being
* invoked only once during a request within a single thread.
* @since 3.2
*/
protected boolean shouldNotFilterAsyncDispatch() {
return true;
@ -199,11 +203,13 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
* processes and error mapped in {@code web.xml}. The default return value
* is "true", which means the filter will not be invoked in case of an error
* dispatch.
* @since 3.2
*/
protected boolean shouldNotFilterErrorDispatch() {
return true;
}
/**
* Same contract as for {@code doFilter}, but guaranteed to be
* just invoked once per request within a single request thread.

View File

@ -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.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* Servlet 2.3 Filter that exposes the request to the current thread,
* Servlet Filter that exposes the request to the current thread,
* through both {@link org.springframework.context.i18n.LocaleContextHolder} and
* {@link RequestContextHolder}. To be registered as filter in {@code web.xml}.
*
@ -68,6 +68,7 @@ public class RequestContextFilter extends OncePerRequestFilter {
this.threadContextInheritable = threadContextInheritable;
}
/**
* Returns "false" so that the filter may set up the request context in each
* asynchronously dispatched thread.

View File

@ -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,7 +29,7 @@ import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartResolver;
/**
* Servlet 2.3 Filter that resolves multipart requests via a MultipartResolver.
* Servlet Filter that resolves multipart requests via a {@link MultipartResolver}.
* in the root web application context.
*
* <p>Looks up the MultipartResolver in Spring's root web application context.

View File

@ -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.
@ -21,9 +21,9 @@ import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
/**
* Servlet 2.3 HttpSessionListener that automatically exposes the
* session mutex when an HttpSession gets created.
* To be registered as a listener in {@code web.xml}.
* Servlet HttpSessionListener that automatically exposes the session mutex
* when an HttpSession gets created. To be registered as a listener in
* {@code web.xml}.
*
* <p>The session mutex is guaranteed to be the same object during
* the entire lifetime of the session, available under the key defined

View File

@ -48,7 +48,7 @@ import org.springframework.web.method.HandlerMethod;
* in the application context, referenced by the mapping bean definition
* via its "interceptors" property (in XML: a &lt;list&gt; of &lt;ref&gt;).
*
* <p>HandlerInterceptor is basically similar to a Servlet 2.3 Filter, but in
* <p>HandlerInterceptor is basically similar to a Servlet Filter, but in
* contrast to the latter it just allows custom pre-processing with the option
* of prohibiting the execution of the handler itself, and custom post-processing.
* Filters are more powerful, for example they allow for exchanging the request

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -170,9 +170,9 @@ public abstract class AbstractTemplateView extends AbstractUrlBasedView {
/**
* Apply this view's content type as specified in the "contentType"
* bean property to the given response.
* <p>When running on Servlet 2.4, only applies the view's contentType
* if no content type has been set on the response before. This allows
* handlers to override the default content type beforehand.
* <p>Only applies the view's contentType if no content type has been
* set on the response before. This allows handlers to override the
* default content type beforehand.
* @param response current HTTP response
* @see #setContentType
*/