Polish "Reuse constant in DispatcherServlet"

Closes gh-1398
This commit is contained in:
Stephane Nicoll
2017-04-25 10:06:51 +02:00
parent 224e369484
commit 239b7086c6

View File

@@ -267,8 +267,8 @@ public class DispatcherServlet extends FrameworkServlet {
/**
* Common prefix that DispatcherServlet's default strategy attributes start with.
*/
private static final String DEFAULT_STRATEGIES_PREFIX = "org.springframework.web.servlet";
private static final String DEFAULT_STRATEGIES_PREFIX = "org.springframework.web.servlet";
/** Additional logger to use when no mapped handler is found for a request. */
protected static final Log pageNotFoundLogger = LogFactory.getLog(PAGE_NOT_FOUND_LOG_CATEGORY);
@@ -1352,7 +1352,7 @@ public class DispatcherServlet extends FrameworkServlet {
Enumeration<?> attrNames = request.getAttributeNames();
while (attrNames.hasMoreElements()) {
String attrName = (String) attrNames.nextElement();
if (this.cleanupAfterInclude || attrName.startsWith("org.springframework.web.servlet")) {
if (this.cleanupAfterInclude || attrName.startsWith(DEFAULT_STRATEGIES_PREFIX)) {
attrsToCheck.add(attrName);
}
}