Removed deprecated helper classes and methods (that have been deprecated since 3.0 or before)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -119,7 +119,6 @@ public class WebDataBinder extends DataBinder {
|
||||
* As the marker parameter is sent in any case, the data binder can
|
||||
* detect an empty field and automatically reset its value.
|
||||
* @see #DEFAULT_FIELD_MARKER_PREFIX
|
||||
* @see org.springframework.web.servlet.mvc.BaseCommandController#onBind
|
||||
*/
|
||||
public void setFieldMarkerPrefix(String fieldMarkerPrefix) {
|
||||
this.fieldMarkerPrefix = fieldMarkerPrefix;
|
||||
@@ -145,7 +144,6 @@ public class WebDataBinder extends DataBinder {
|
||||
* <p>The presence of a default parameter preempts the behavior of a field
|
||||
* marker for the given field.
|
||||
* @see #DEFAULT_FIELD_DEFAULT_PREFIX
|
||||
* @see org.springframework.web.servlet.mvc.BaseCommandController#onBind
|
||||
*/
|
||||
public void setFieldDefaultPrefix(String fieldDefaultPrefix) {
|
||||
this.fieldDefaultPrefix = fieldDefaultPrefix;
|
||||
@@ -267,30 +265,6 @@ public class WebDataBinder extends DataBinder {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Bind the multipart files contained in the given request, if any
|
||||
* (in case of a multipart request).
|
||||
* <p>Multipart files will only be added to the property values if they
|
||||
* are not empty or if we're configured to bind empty multipart files too.
|
||||
* @param multipartFiles Map of field name String to MultipartFile object
|
||||
* @param mpvs the property values to be bound (can be modified)
|
||||
* @see org.springframework.web.multipart.MultipartFile
|
||||
* @see #setBindEmptyMultipartFiles
|
||||
* @deprecated as of Spring 3.0, in favor of {@link #bindMultipart} which binds
|
||||
* all multipart files, even if more than one sent for the same name
|
||||
*/
|
||||
@Deprecated
|
||||
protected void bindMultipartFiles(Map<String, MultipartFile> multipartFiles, MutablePropertyValues mpvs) {
|
||||
for (Map.Entry<String, MultipartFile> entry : multipartFiles.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
MultipartFile value = entry.getValue();
|
||||
if (isBindEmptyMultipartFiles() || !value.isEmpty()) {
|
||||
mpvs.add(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind all multipart files contained in the given request, if any
|
||||
* (in case of a multipart request).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2013 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.
|
||||
@@ -40,9 +40,6 @@ import javax.servlet.ServletContextListener;
|
||||
*/
|
||||
public class ContextLoaderListener extends ContextLoader implements ServletContextListener {
|
||||
|
||||
private ContextLoader contextLoader;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new {@code ContextLoaderListener} that will create a web application
|
||||
* context based on the "contextClass" and "contextConfigLocation" servlet
|
||||
@@ -105,33 +102,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte
|
||||
* Initialize the root web application context.
|
||||
*/
|
||||
public void contextInitialized(ServletContextEvent event) {
|
||||
this.contextLoader = createContextLoader();
|
||||
if (this.contextLoader == null) {
|
||||
this.contextLoader = this;
|
||||
}
|
||||
this.contextLoader.initWebApplicationContext(event.getServletContext());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the ContextLoader to use. Can be overridden in subclasses.
|
||||
* @return the new ContextLoader
|
||||
* @deprecated in favor of simply subclassing ContextLoaderListener itself
|
||||
* (which extends ContextLoader, as of Spring 3.0)
|
||||
*/
|
||||
@Deprecated
|
||||
protected ContextLoader createContextLoader() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the ContextLoader used by this listener.
|
||||
* @return the current ContextLoader
|
||||
* @deprecated in favor of simply subclassing ContextLoaderListener itself
|
||||
* (which extends ContextLoader, as of Spring 3.0)
|
||||
*/
|
||||
@Deprecated
|
||||
public ContextLoader getContextLoader() {
|
||||
return this.contextLoader;
|
||||
initWebApplicationContext(event.getServletContext());
|
||||
}
|
||||
|
||||
|
||||
@@ -139,9 +110,7 @@ public class ContextLoaderListener extends ContextLoader implements ServletConte
|
||||
* Close the root web application context.
|
||||
*/
|
||||
public void contextDestroyed(ServletContextEvent event) {
|
||||
if (this.contextLoader != null) {
|
||||
this.contextLoader.closeWebApplicationContext(event.getServletContext());
|
||||
}
|
||||
closeWebApplicationContext(event.getServletContext());
|
||||
ContextCleanupListener.cleanupAttributes(event.getServletContext());
|
||||
}
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2012 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 the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.web.context.support;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
/**
|
||||
* {@link FactoryBean} that exposes the ServletContext for bean references.
|
||||
* Can be used as alternative to implementing the ServletContextAware
|
||||
* callback interface. Allows for passing the ServletContext reference
|
||||
* to a constructor argument or any custom bean property.
|
||||
*
|
||||
* <p>Note that there's a special FactoryBean for exposing a specific
|
||||
* ServletContext attribute, named ServletContextAttributeFactoryBean.
|
||||
* So if all you need from the ServletContext is access to a specific
|
||||
* attribute, ServletContextAttributeFactoryBean allows you to expose
|
||||
* a constructor argument or bean property of the attribute type,
|
||||
* which is a preferable to a dependency on the full ServletContext.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1.4
|
||||
* @see javax.servlet.ServletContext
|
||||
* @see org.springframework.web.context.ServletContextAware
|
||||
* @see ServletContextAttributeFactoryBean
|
||||
* @see org.springframework.web.context.WebApplicationContext#SERVLET_CONTEXT_BEAN_NAME
|
||||
* @deprecated as of Spring 3.0, since "servletContext" is now available
|
||||
* as a default bean in every WebApplicationContext
|
||||
*/
|
||||
@Deprecated
|
||||
public class ServletContextFactoryBean implements FactoryBean<ServletContext>, ServletContextAware {
|
||||
|
||||
private ServletContext servletContext;
|
||||
|
||||
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.servletContext = servletContext;
|
||||
}
|
||||
|
||||
|
||||
public ServletContext getObject() {
|
||||
return this.servletContext;
|
||||
}
|
||||
|
||||
public Class<? extends ServletContext> getObjectType() {
|
||||
return (this.servletContext != null ? this.servletContext.getClass() : ServletContext.class);
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user