提交 88ff3c9a 编写于 作者: J Juergen Hoeller

only try to restore attribute if the value differs (ignoring Portlet spec attributes; SPR-6712)

上级 f82563fb
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2010 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.
......@@ -1151,17 +1151,17 @@ public class DispatcherServlet extends FrameworkServlet {
// or removing the attribute, respectively, if appropriate.
for (String attrName : attrsToCheck) {
Object attrValue = attributesSnapshot.get(attrName);
if (attrValue != null) {
if (attrValue == null){
if (logger.isDebugEnabled()) {
logger.debug("Restoring original value of attribute [" + attrName + "] after include");
logger.debug("Removing attribute [" + attrName + "] after include");
}
request.setAttribute(attrName, attrValue);
request.removeAttribute(attrName);
}
else {
else if (attrValue != request.getAttribute(attrName)) {
if (logger.isDebugEnabled()) {
logger.debug("Removing attribute [" + attrName + "] after include");
logger.debug("Restoring original value of attribute [" + attrName + "] after include");
}
request.removeAttribute(attrName);
request.setAttribute(attrName, attrValue);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册