1 May 2007 20:11
Commented: (SHALE-409) Shale 1.0.4+ incorrectly removes all entries in the request map after render response
Matt Hughes (JIRA <jira <at> apache.org>
2007-05-01 18:11:42 GMT
2007-05-01 18:11:42 GMT
[
https://issues.apache.org/struts/browse/SHALE-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40918
]
Matt Hughes commented on SHALE-409:
-----------------------------------
There clearly is a bug in this method. In the first while block, it finds all keys in the request map whose
value is of a certain type. And then in the second while block, it finds all keys in the map that it hasn't
already added before. Therefore, after the second while block, the 'list' variable has EVERY KEY that was
in the original map. If that is really what you intended, you could have made the method a lot simpler:
map.clear(). I would submit a fix for this but I really can't figure out what that second while block is
trying to do. Any ideas? This bug breaks ajax4jsf as well as any other library expecting their request
attributes to stay put.
// In ViewPhaseListener
private void afterRenderResponse(PhaseEvent event) {
// Initialize local values we will need
Map map = event.getFacesContext().getExternalContext().getRequestMap();
// Remove our list of initialized views explicitly
map.remove(FacesConstants.VIEWS_INITIALIZED);
List list = new ArrayList();
Iterator entries = map.entrySet().iterator();
// First select all the ViewController and AbstractRequestBean instances
while (entries.hasNext()) {
Map.Entry entry = (Map.Entry) entries.next();
(Continue reading)
RSS Feed