@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 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.
|
||||
@@ -328,6 +328,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
/** List of ViewResolvers used by this servlet */
|
||||
private List<ViewResolver> viewResolvers;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new {@code DispatcherServlet} that will create its own internal web
|
||||
* application context based on defaults and values provided through servlet
|
||||
@@ -392,6 +393,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
super(webApplicationContext);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set whether to detect all HandlerMapping beans in this servlet's context. Otherwise,
|
||||
* just a single bean with name "handlerMapping" will be expected.
|
||||
@@ -463,6 +465,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
this.cleanupAfterInclude = cleanupAfterInclude;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This implementation calls {@link #initStrategies}.
|
||||
*/
|
||||
@@ -547,9 +550,8 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
// We need to use the default.
|
||||
this.themeResolver = getDefaultStrategy(context, ThemeResolver.class);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(
|
||||
"Unable to locate ThemeResolver with name '" + THEME_RESOLVER_BEAN_NAME + "': using default [" +
|
||||
this.themeResolver + "]");
|
||||
logger.debug("Unable to locate ThemeResolver with name '" + THEME_RESOLVER_BEAN_NAME +
|
||||
"': using default [" + this.themeResolver + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -737,8 +739,7 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
*/
|
||||
private void initFlashMapManager(ApplicationContext context) {
|
||||
try {
|
||||
this.flashMapManager =
|
||||
context.getBean(FLASH_MAP_MANAGER_BEAN_NAME, FlashMapManager.class);
|
||||
this.flashMapManager = context.getBean(FLASH_MAP_MANAGER_BEAN_NAME, FlashMapManager.class);
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Using FlashMapManager [" + this.flashMapManager + "]");
|
||||
}
|
||||
@@ -838,7 +839,8 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
|
||||
/**
|
||||
* Create a default strategy.
|
||||
* <p>The default implementation uses {@link org.springframework.beans.factory.config.AutowireCapableBeanFactory#createBean}.
|
||||
* <p>The default implementation uses
|
||||
* {@link org.springframework.beans.factory.config.AutowireCapableBeanFactory#createBean}.
|
||||
* @param context the current WebApplicationContext
|
||||
* @param clazz the strategy implementation class to instantiate
|
||||
* @return the fully configured strategy instance
|
||||
@@ -1099,7 +1101,8 @@ public class DispatcherServlet extends FrameworkServlet {
|
||||
* @see MultipartResolver#cleanupMultipart
|
||||
*/
|
||||
protected void cleanupMultipart(HttpServletRequest request) {
|
||||
MultipartHttpServletRequest multipartRequest = WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class);
|
||||
MultipartHttpServletRequest multipartRequest =
|
||||
WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class);
|
||||
if (multipartRequest != null) {
|
||||
this.multipartResolver.cleanupMultipart(multipartRequest);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ import org.springframework.http.HttpMethod;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.context.ConfigurableWebApplicationContext;
|
||||
import org.springframework.web.context.ConfigurableWebEnvironment;
|
||||
import org.springframework.web.context.ContextLoader;
|
||||
@@ -916,7 +915,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
|
||||
@Override
|
||||
public void setHeader(String name, String value) {
|
||||
if ("Allow".equals(name)) {
|
||||
value = (StringUtils.hasLength(value) ? value + ", " : "") + RequestMethod.PATCH.name();
|
||||
value = (StringUtils.hasLength(value) ? value + ", " : "") + HttpMethod.PATCH.name();
|
||||
}
|
||||
super.setHeader(name, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user