Details
Description
The problem is org.icefaces.impl.FormSubmit: The "guard against duplicates within the same JSF lifecycle" doesn't work in case of navigation because it relies on a FacesContext attribute. After a navigation the attribute is still there but because the ViewRoot changed the scriptWriter is actually not contained as a children of the form anymore.
-
Hide
- icefacesSupport.war
- 6.14 MB
- Adrian Gygax
-
- META-INF/MANIFEST.MF 0.0 kB
- META-INF/context.xml 0.1 kB
- WEB-INF/classes/.../MyBean.java 0.4 kB
- WEB-INF/classes/.../MyBean.class 0.7 kB
- WEB-INF/classes/.../event/FormSubmit.java 6 kB
- WEB-INF/classes/.../AjaxDisabledWriter.class 2 kB
- WEB-INF/classes/.../event/FormSubmit$1.class 2 kB
- WEB-INF/classes/.../event/FormSubmit.class 4 kB
- WEB-INF/faces-config.xml 0.3 kB
- WEB-INF/lib/commons-beanutils.jar 226 kB
- WEB-INF/lib/commons-digester.jar 140 kB
- WEB-INF/lib/commons-logging.jar 52 kB
- WEB-INF/lib/icefaces-ee-compat.jar 2.67 MB
- WEB-INF/lib/icefaces-ee.jar 206 kB
- WEB-INF/lib/jsf-api-2.1.2.jar 611 kB
- WEB-INF/lib/jsf-impl-2.1.2.jar 1.85 MB
- WEB-INF/lib/jstl.jar 20 kB
- WEB-INF/lib/jxl.jar 708 kB
- WEB-INF/.../krysalis-jCharts-1.0.0-alpha-1.jar 151 kB
- WEB-INF/web.xml 0.8 kB
- index.xhtml 0.6 kB
- index2.xhtml 0.6 kB
- resources/prop/fieldset.xhtml 0.6 kB
- resources/prop/line.xhtml 0.8 kB
- resources/prop/property.xhtml 1 kB
- resources/prop/propertyText.xhtml 2 kB
- resources/prop/.../propertyTemplate.xhtml 0.5 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Request scope attribute or View Scope attribute can be used instead of FacesContext attribute (request scope likely preferred).
Navigation tests need to be checked to see why this passed regression.
It was also observed that a dummy bean is always added to window scope resulting in extra HTTP requests upon every navigation.
Change duplicate detection logic to check for the existence of the dynamically added component among the children of the current form instead of checking a flag set in the FacesContext's attribute map.
The recommended fix was applied with a slight modification, the flag set in the FacesContext's attribute map to detect duplicates was removed since it became redundant.
The "view scope retained test" case in 'scopes' application was detecting this issue already, so there is no need for additional tests.
Attached a sample project including a patched FormSubmit which fixes the problem (See the "PATCHED" comment).
To reproduce the problem simply remove the patched class and click twice on the button. The second button click will issue a normal request, not an Ajax one and the <script> tag is missing in the DOM.