Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.3, 1.6DR#5
-
Fix Version/s: 2.0-Alpha3, 2.0.0
-
Component/s: ICE-Components
-
Labels:None
-
Environment:any
-
ICEsoft Forum Reference:
-
Support Case References:
-
Workaround Exists:Yes
-
Workaround Description:Hidecreated a simple test case:
- pageA contains inputText and commandButton to navigate to pageB
- pageB contains outputText to show inputText's value from pageA and commandButton to navigate back to pageA
- both the inputText and outputText components are bound to the same backing bean
only if the standardRequestScope context-param is set to true in web.xml, the submittedValue is cleared when the user navigates back to pageA
Showcreated a simple test case: - pageA contains inputText and commandButton to navigate to pageB - pageB contains outputText to show inputText's value from pageA and commandButton to navigate back to pageA - both the inputText and outputText components are bound to the same backing bean only if the standardRequestScope context-param is set to true in web.xml, the submittedValue is cleared when the user navigates back to pageA
Description
this is only possible when the standardRequestScope context parameter in web.xml is set to true.
if there are any validation errors and the user navigates back to the original page, the old submittedValues
are still remaining. usually one would expect the submittedValues always to be cleared when a real navigation
is initiated to another page
-
Hide
- forum-4756.war
- 4.64 MB
- Michael Thiem
-
- META-INF/MANIFEST.MF 0.0 kB
- WEB-INF/.../CommandButtonRenderer.class 2 kB
- WEB-INF/classes/.../request/Request.class 2 kB
- WEB-INF/classes/.../TestValidator.class 1 kB
- WEB-INF/faces-config.xml 1 kB
- WEB-INF/html_basic.tld 244 kB
- WEB-INF/jsf_core.tld 25 kB
- WEB-INF/lib/backport-util-concurrent.jar 343 kB
- WEB-INF/lib/commons-beanutils.jar 100 kB
- WEB-INF/lib/commons-collections.jar 164 kB
- WEB-INF/lib/commons-digester.jar 96 kB
- WEB-INF/lib/commons-fileupload.jar 52 kB
- WEB-INF/lib/commons-logging.jar 27 kB
- WEB-INF/lib/el-api.jar 24 kB
- WEB-INF/lib/el-ri.jar 97 kB
- WEB-INF/lib/icefaces-comps.jar 625 kB
- WEB-INF/lib/icefaces-facelets.jar 574 kB
- WEB-INF/lib/icefaces.jar 643 kB
- WEB-INF/lib/jsf-api.jar 324 kB
- WEB-INF/lib/jsf-impl.jar 602 kB
- WEB-INF/lib/jstl.jar 17 kB
- WEB-INF/.../krysalis-jCharts-1.0.0-alpha-1.jar 151 kB
- WEB-INF/lib/standard.jar 343 kB
- WEB-INF/lib/xercesImpl.jar 987 kB
- WEB-INF/lib/xml-apis.jar 122 kB
- WEB-INF/tld/icefaces_component.tld 535 kB
- WEB-INF/web.xml 3 kB
- index.jsp 0.2 kB
- js/myscript.js 0.1 kB
- pageA.xhtml 2 kB
-
Hide
- forum-4756-src.zip
- 78 kB
- Michael Thiem
-
- forum-4756/.../CommandButtonRenderer.class 2 kB
- forum-4756/WebRoot/.../request/Request.class 2 kB
- forum-4756/WebRoot/.../TestValidator.class 1 kB
- forum-4756/WebRoot/.../.faces-config.mex 0.9 kB
- forum-4756/WebRoot/.../html_basic.tld 244 kB
- forum-4756/WebRoot/WEB-INF/jsf_core.tld 25 kB
- forum-4756/.../icefaces_component.tld 535 kB
- forum-4756/WebRoot/.../faces-config.xml 1 kB
- forum-4756/WebRoot/WEB-INF/web.xml 3 kB
- forum-4756/WebRoot/META-INF/MANIFEST.MF 0.0 kB
- forum-4756/WebRoot/pageA.xhtml 2 kB
- forum-4756/WebRoot/index.jsp 0.2 kB
- forum-4756/WebRoot/pageB.xhtml 1 kB
- forum-4756/WebRoot/js/myscript.js 0.1 kB
- forum-4756/.../CommandButtonRenderer.java 1 kB
- forum-4756/src/com/.../request/Request.java 2 kB
- forum-4756/src/.../TestValidator.java 0.6 kB
-
Hide
- ICE-1741.war
- 4.65 MB
- Sam Xiao
-
- META-INF/MANIFEST.MF 0.1 kB
- WEB-INF/classes/com/.../bean/TestBean.class 0.6 kB
- WEB-INF/classes/com/.../bean/TestBean.java 0.3 kB
- WEB-INF/faces-config.xml 1 kB
- WEB-INF/lib/backport-util-concurrent.jar 343 kB
- WEB-INF/lib/commons-beanutils.jar 184 kB
- WEB-INF/lib/commons-collections.jar 558 kB
- WEB-INF/lib/commons-digester.jar 107 kB
- WEB-INF/lib/commons-discovery.jar 70 kB
- WEB-INF/lib/commons-el.jar 110 kB
- WEB-INF/lib/commons-fileupload.jar 52 kB
- WEB-INF/lib/commons-logging.jar 52 kB
- WEB-INF/lib/el-api.jar 24 kB
- WEB-INF/lib/icefaces-comps.jar 625 kB
- WEB-INF/lib/icefaces.jar 690 kB
- WEB-INF/lib/jsf-api.jar 356 kB
- WEB-INF/lib/jsf-impl.jar 778 kB
- WEB-INF/lib/jstl.jar 17 kB
- WEB-INF/lib/xercesImpl.jar 1.15 MB
- WEB-INF/lib/xml-apis.jar 190 kB
- index.jsp 0.2 kB
- main.jspx 0.7 kB
- next.jspx 0.7 kB
- WEB-INF/web.xml 3 kB
Issue Links
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Are the navigation rules doing redirects? If forwards are used then no new requests are made, requests that will update the request parameters, thus the parameters used in the first request are reused to render next view.
That's correct. Using redirects in navigation rules cause the submitted values to be overwritten on each redirect to another page. When redirects are commented out and forwards are used instead the values will be reused.
this test case can be adjusted appropriately. when using redirects the values are null anytime a navigation rule is initiated.
when redirects are commented out, the textField's value will be stored in the bean property and then be set to null when navigating back to pageA. (standardRequestScope must be set to true then).
After taking a close look at what's going on I can say that the behavior is the correct one.
- Component level
The submitted value acquired with HtmlInputText.getSubmittedValue() is null on page navigation from pageB to pageA because a new component tree is created (when using D2DFaceletViewHandler) thus HtmlInputText's 'submittedValue' field is initialized with the null value.
- Bean level
When standardRequestScope=false the request is long lived, so even if the beans have request scope they are reused between Ajax requests and recreated only on full page requests such as page load, reload or redirect.
So, in the attached test case com.icesoft.icefaces.samples.request.Request bean is instantiated only once when forwards are used and that's why we don't see it's 'stringOne' field reset.
'standardRequestScope' was specifically introduced for cases where applications require standard JSF behavior.
This issue is causing a lot of problems for many customers where adopting standard request scope is not a viable solution. We should consider clearing the old component tree ourselves when a page navigation event occurs.
Are the backing beans the same on the two different pages? The observed behaviour may have nothing to do with the state of the component tree.
The bean is the same on both pages
Since the bean is the same on both pages, this could be regarded as expected application behavior. In many cases, the ability to share data between pages is useful. In this case, the developer does not want to share data between pages, so perhaps the solution is to use distinctly named managed beans on the two different pages.
If the page is produced by JSP rather than Facelets, the submitted values may be retained in the component tree.
Since Facelets reproduces the component tree from the handlers each time, the two may behave differently.
Mircea, could you investigate a JSP case as well as the Facelets case?
Two potential fixes have been proposed:
1. clear out the submittedValues in the component tree for each request
2. regenerate the component for each request in JSP mode
2. is potentially higher risk because of the interaction with ICEfaces JSP parsing and may be better addressed when we adopt full JSP component tree generation, such as with JSF 1.2.
Fixed as a side-effect when fixing ICE-2189. Forward navigation rules now force a page reload which in turn re-creates the request map.
Stop propagating attributes between page reloads.
Re-opening as the fix for this causes backward-compatibility issues and must be reverted for the 1.7 release.
Need to replace the current extended Request scope with Std. Request scope behavior + a new scope.
The code area needing to be changed (ServletExternalContext.class) to fix this issue will reside in JSF 2.0.
The same happens in 1.5.3. Only when the standardRequestScope in web.xml is set to true,
the request scoped backing beans become finalized and reinstantiated when navigating between
different pages. This is to be expected default behaviour...