Issue Details (XML | Word | Printable)

Key: JAVASERVERFACES_SPEC_PUBLIC-220
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Ed Burns
Reporter: reind
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
javaserverfaces-spec-public

Prevent "id" attribute name-collision on ViewState saving hidden inputs.

Created: 24/Oct/06 12:28 PM   Updated: 10/Feb/12 08:42 PM   Resolved: 09/Feb/12 05:25 AM
Component/s: Lifecycle
Affects Version/s: 1.2
Fix Version/s: 2.2

Time Tracking:
Not Specified

File Attachments: 1. Text File changebundle.txt (9 kB) 09/Feb/12 04:17 PM - Ed Burns

Environment:

Operating System: All
Platform: All

Issue Links:
Dependency
 

Issuezilla Id: 220
Status Whiteboard:

cat2 frame renderkitdoc size_medium importance_large

Tags:
Participants: arjan tijms, Ed Burns, reind, rogerk, Ryan Lubke and slominskir


 Description  « Hide

More than 1 <h:form> per view breaks W3C XHTML 1.0 Transitional (and above)
validation. The 1.2 spec calls for the use of a hidden input field with a
constant id which causes name collision on the "id" attribute if more than 1
<h:form> is used.

From w3.org:
"An "id" is a unique identifier. Each time this attribute is used in a document
it must have a different value."

The javadocs for javax.faces.render.ResponseStateManager read:

"VIEW_STATE_PARAM
public static final java.lang.String VIEW_STATE_PARAM
Implementations must use this value as the name and id of the client parameter
in which to save the state between requests."

That is obviously a problem if there are more than one form, and hence more than
one client parameter with this same id.

This problem is also mentioned:
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=433



Ryan Lubke added a comment - 06/Nov/06 12:33 PM
      • Issue 222 has been marked as a duplicate of this issue. ***

rogerk added a comment - 06/Nov/06 01:12 PM

set target milestone - 2.0


Ryan Lubke added a comment - 20/Aug/08 02:45 PM
      • Issue 357 has been marked as a duplicate of this issue. ***

Ed Burns added a comment - 24/Sep/09 08:44 AM

2.1


Ed Burns added a comment - 24/Nov/09 07:48 AM

Prepare to delete "spec" subcomponent.


Ed Burns added a comment - 14/Dec/09 08:59 AM

Move these to unscheduled because we need to target them correctly. 2.next isn't
specific enough.


Ed Burns added a comment - 04/Mar/10 12:40 PM

cat2


Ed Burns added a comment - 17/Mar/10 02:13 PM

frame


Ed Burns added a comment - 22/Mar/10 06:35 AM

lifecycle


Ed Burns added a comment - 15/May/10 07:54 AM

These are targeted at 2.1.


Ed Burns added a comment - 08/Jun/10 02:13 PM

triage


Ed Burns added a comment - 22/Jun/10 09:05 PM

sheetalv


rogerk added a comment - 27/Oct/10 10:56 AM

triage


Ed Burns added a comment - 06/Jun/11 05:36 PM

Bulk assign all of Sheetal's spec issues to me.


slominskir added a comment - 29/Jul/11 06:16 PM

This is an extremely annoying and blatant bug that appears to have an easy fix: just use the name attribute instead of the id attribute. Why wasn't this fixed 5 years ago? The context init parameter configuration option (com.sun.faces.enableViewStateIdRendering) workaround leaves me wondering if I'm breaking something.


Ed Burns added a comment - 27/Jan/12 09:21 PM

I sent mail to the EG about this, but because there is a well-known config param to do exactly what you request, I cannot leave it as a high priority issue.


Ed Burns added a comment - 30/Jan/12 04:04 PM

Cagatay and Bernd Mueller approved.


Ed Burns added a comment - 30/Jan/12 07:49 PM

Committed to trunk.

Sending jsf-api/src/main/java/javax/faces/render/ResponseStateManager.java
Sending jsf-demo/archive/renderkits/src/script/http-svg.es
Sending jsf-demo/archive/renderkits/src/script/http-xul.es
Sending jsf-ri/src/main/java/com/sun/faces/config/WebConfiguration.java
Sending jsf-ri/src/main/java/com/sun/faces/renderkit/StateHelper.java
Sending jsf-ri/systest/src/com/sun/faces/systest/jsp/htmltaglib/HtmlTaglibTestCase.java
Sending jsf-ri/systest/web/regexp/converter06.txt
Sending jsf-ri/systest-per-webapp/no-web-xml/src/java/com/sun/faces/systest/NoWebXMLTestCase.java
Sending jsf-ri/web/test/RenderResponse_correct
Sending jsf-ri/web/test/TestLifecycleImpl_initial_correct
Sending jsf-ri/web/test/TestViewHandlerImpl_correct
Sending jsf-test/JAVASERVERFACES-1655/htmlunit/src/main/java/com/sun/faces/systest/InitialTestCase.java
Transmitting file data ............
Committed revision 9620.


Ed Burns added a comment - 06/Feb/12 05:59 PM

Re-open to address additional complexity surfaced in EG discussion on 30 Jan 2012.


Ed Burns added a comment - 06/Feb/12 05:59 PM

Because this hampers portlets, we need to give this major priority.



Ed Burns added a comment - 09/Feb/12 05:25 AM

Committed new approach to trunk.

Adding jsf-api/doc/web-partialresponse_2_2.xsd
Sending jsf-api/src/main/java/javax/faces/context/FacesContext.java
Sending jsf-api/src/main/java/javax/faces/context/FacesContextWrapper.java
Sending jsf-api/src/main/java/javax/faces/context/PartialResponseWriter.java
Sending jsf-api/src/main/java/javax/faces/render/ResponseStateManager.java
Sending jsf-api/src/main/resources/jsf.js
Sending jsf-demo/archive/renderkits/src/script/http-svg.es
Sending jsf-demo/archive/renderkits/src/script/http-xul.es
Sending jsf-ri/src/main/java/com/sun/faces/application/StateManagerImpl.java
Sending jsf-ri/src/main/java/com/sun/faces/application/resource/ClasspathResourceHelper.java
Sending jsf-ri/src/main/java/com/sun/faces/application/resource/ResourceHelper.java
Sending jsf-ri/src/main/java/com/sun/faces/application/resource/WebappResourceHelper.java
Sending jsf-ri/src/main/java/com/sun/faces/context/PartialViewContextImpl.java
Sending jsf-ri/src/main/java/com/sun/faces/renderkit/ClientSideStateHelper.java
Sending jsf-ri/src/main/java/com/sun/faces/renderkit/ServerSideStateHelper.java
Sending jsf-ri/src/main/java/com/sun/faces/renderkit/StateHelper.java
Sending jsf-ri/src/main/java/com/sun/faces/util/DebugUtil.java
Sending jsf-ri/src/main/java/com/sun/faces/util/Util.java
Sending jsf-ri/systest/build-tests.xml
Sending jsf-ri/systest/src/com/sun/faces/systest/jsp/htmltaglib/HtmlTaglibTestCase.java
Sending jsf-ri/systest/web/regexp/converter06.txt
Sending jsf-ri/systest-per-webapp/no-web-xml/src/java/com/sun/faces/systest/NoWebXMLTestCase.java
Sending jsf-ri/test/com/sun/faces/application/TestStateManagerImpl.java
Sending jsf-ri/web/test/RenderResponse_correct
Sending jsf-ri/web/test/TestLifecycleImpl_initial_correct
Sending jsf-ri/web/test/TestViewHandlerImpl_correct
Sending jsf-test/JAVASERVERFACES-1655/htmlunit/src/main/java/com/sun/faces/systest/InitialTestCase.java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/build.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/pom.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java/com
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java/com/sun
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java/com/sun/faces
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java/com/sun/faces/test
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java/com/sun/faces/test/i_spec_220_client_state_war
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/java/com/sun/faces/test/i_spec_220_client_state_war/UserBean.java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/webapp
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/webapp/WEB-INF
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/webapp/WEB-INF/beans.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/webapp/WEB-INF/web.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_client_state_war/src/main/webapp/main.xhtml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/pom.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java/com
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java/com/sun
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java/com/sun/faces
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java/com/sun/faces/test
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java/com/sun/faces/test/i_spec_220_htmlunit
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/java/com/sun/faces/test/i_spec_220_htmlunit/IssueSpec220TestCase.java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_htmlunit/src/main/resources
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/pom.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java/com
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java/com/sun
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java/com/sun/faces
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java/com/sun/faces/test
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java/com/sun/faces/test/i_spec_220_server_state_war
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/java/com/sun/faces/test/i_spec_220_server_state_war/UserBean.java
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/webapp
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/webapp/WEB-INF
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/webapp/WEB-INF/beans.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/webapp/WEB-INF/web.xml
Adding jsf-test/JAVASERVERFACES_SPEC_PUBLIC-220/i_spec_220_server_state_war/src/main/webapp/main.xhtml
Sending jsf-test/build.xml
Transmitting file data .........................................
Committed revision 9660.