Skip to content

Commit

Permalink
Fix issue with restoring included attributes
Browse files Browse the repository at this point in the history
Before this change the DispatcherServlet restored modified and also
removed added attributes but did not restore removed attributes.

Issue: SPR-10360
  • Loading branch information
rstoyanchev committed Mar 11, 2013
1 parent e9f7445 commit 0fb4b74
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -1268,6 +1268,7 @@ private void triggerAfterCompletionWithError(HttpServletRequest request, HttpSer
* @param request current HTTP request
* @param attributesSnapshot the snapshot of the request attributes before the include
*/
@SuppressWarnings("unchecked")
private void restoreAttributesAfterInclude(HttpServletRequest request, Map<?,?> attributesSnapshot) {
logger.debug("Restoring snapshot of request attributes after include");

Expand All @@ -1282,6 +1283,9 @@ private void restoreAttributesAfterInclude(HttpServletRequest request, Map<?,?>
}
}

// Add attributes that may have been removed
attrsToCheck.addAll((Set<String>) attributesSnapshot.keySet());

// Iterate over the attributes to check, restoring the original value
// or removing the attribute, respectively, if appropriate.
for (String attrName : attrsToCheck) {
Expand Down

0 comments on commit 0fb4b74

Please sign in to comment.