[
https://issues.apache.org/jira/browse/MYFACES-4533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17678723#comment-17678723
]
Werner Punz commented on MYFACES-4533:
--------------------------------------
I have everything except the named nav case working now, which I have not yet
had time to debug into.
However I noticed one thing. In @volosied s patch, there is an extra attribute
introduced into the process-response named
namedResponse
This is an extra attribute. The problem is you basically need this attribute
otherwise you do not have any chance to determine whether you are in a naming
container scenario.
The initially rendered html is following:
{code:html}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JAVASERVERFACES_SPEC_PUBLIC-790 - Integration Test - Namespaced
View</title>
<script
src="/de8e8b48-bef7-46d0-af8c-9064915d50d6/jakarta.faces.resource/faces.js.xhtml;jsessionid=B804E11746DF5F8602438EB8F27CC681?ln=jakarta.faces&stage=Development"></script>
</head>
<body>
<div id="j_id__v_0:panel1">
<form id="j_id__v_0:form1" name="j_id__v_0:form1" method="post"
action="/de8e8b48-bef7-46d0-af8c-9064915d50d6/spec790WithNamespacedView.xhtml;jsessionid=B804E11746DF5F8602438EB8F27CC681"
enctype="application/x-www-form-urlencoded"><input
id="j_id__v_0:form1:button" name="j_id__v_0:form1:button"
type="submit"
value="submit
form1 and render panel2 and panel3 using h:commandButton f:ajax"
onclick="faces.util.chain(this,
event,function(event){myfaces.ab(this,event,'action','j_id__v_0:form1','j_id__v_0:panel2
j_id__v_0:panel3')}); return false;"><input
type="hidden" name="j_id__v_0:form1_SUBMIT" value="1"><input
type="hidden"
name="j_id__v_0:jakarta.faces.ViewState"
id="j_id__v_0:jakarta.faces.ViewState:1"
value="OTg0YmQzZGJmNDRiYzVmMjAwMDAwMDAx"
autocomplete="off"></form>
</div>
{code}
Now this clearly is a naming container scenario from the backend, the names are
properly prefixed
and also the process response has the id="j_id__v_0"
However in the non naming container test we have a similar rendering, same id
in the process response but the main difference is the names of the viewState
elements:
{code:html}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>JAVASERVERFACES_SPEC_PUBLIC-790 - Integration Test</title>
<script
src="/9ce5cf1c-6e66-46c1-84e0-b7f1b82694ff/jakarta.faces.resource/faces.js.xhtml;jsessionid=980FD086A5B92B3F94C0A06E82BA41A8?ln=jakarta.faces&stage=Development"></script>
</head>
<body>
<div id="panel1">
<form id="form1" name="form1" method="post"
action="/9ce5cf1c-6e66-46c1-84e0-b7f1b82694ff/spec790.xhtml;jsessionid=980FD086A5B92B3F94C0A06E82BA41A8"
enctype="application/x-www-form-urlencoded"><input id="form1:button"
name="form1:button" type="submit"
value="submit
form1 and render panel2 and panel3 using h:commandButton f:ajax"
onclick="faces.util.chain(this,
event,function(event){myfaces.ab(this,event,'action','form1','panel2
panel3')}); return false;"><input
type="hidden" name="form1_SUBMIT" value="1"><input type="hidden"
name="jakarta.faces.ViewState"
id="j_id__v_0:jakarta.faces.ViewState:1"
value="NmU1ZDA2OTUxYTNjMzE5MzAwMDAwMDAx"
autocomplete="off"></form>
</div>
{code}
So we have two options now in the response xml the main difference is that
myfaces sets the namedResponse is set to false.
Now, namedResponse is not standard and an extra attribute, hence breaks the
spec.
There might be another option on the client side, we can check whether any
existing viewstate element has the prefix named, then we know we have a named
container!
I would prefer the second option which does not change the protocol and should
work on both implementations!
> TCK: Spec 790: Viewstate input element's name attribute should be prefixed
> with naming container id
> -----------------------------------------------------------------------------------------------------
>
> Key: MYFACES-4533
> URL: https://issues.apache.org/jira/browse/MYFACES-4533
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 4.0.0-RC2
> Reporter: Volodymyr Siedlecki
> Assignee: Werner Punz
> Priority: Major
> Attachments: image-2023-01-19-08-44-48-874.png,
> image-2023-01-19-08-48-12-961.png, namespacedView.war
>
>
> Failing Line:
> https://github.com/jakartaee/faces/blob/master/tck/faces23/namespacedView/src/test/java/ee/jakarta/tck/faces/test/javaee8/namespacedView/Spec790WithNamespacedViewIT.java#L15
> 5
> Generated Viewstate:
> {code:java}
> <input type="hidden" name="jakarta.faces.ViewState"
> id="j_id__v_0:jakarta.faces.ViewState:1"
> value="NzVhMDlkOGYwNjY1ZWZkODAwMDAwMDAy" autocomplete="off">
> {code}
> The test expects the name attribute to be prefixed with `j_id__v_0`. My
> understanding is this should only apply when the view root is an instance of
> a NamingContainer.
> The test app's faces-config has the following configuration:
> https://github.com/jakartaee/faces/blob/master/tck/faces23/namespacedView/src/main/webapp/WEB-INF/faces-config.xml#L25-L28
--
This message was sent by Atlassian Jira
(v8.20.10#820010)