You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2011/09/23 15:29:26 UTC
[jira] [Created] (MYFACES-3321) Script fragments evaluated after an
ajax operation encode '&' character into '&'
Script fragments evaluated after an ajax operation encode '&' character into '&'
------------------------------------------------------------------------------------
Key: MYFACES-3321
URL: https://issues.apache.org/jira/browse/MYFACES-3321
Project: MyFaces Core
Issue Type: Bug
Components: JSR-314
Reporter: Leonardo Uribe
Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) Script fragments evaluated after
an ajax operation encode '&' character into '&'
Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114047#comment-13114047 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
I will investigate this issue sometime next week
> Script fragments evaluated after an ajax operation encode '&' character into '&'
> ------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (MYFACES-3321) jsf.js: Script fragments evaluated
after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Resolved) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Werner Punz resolved MYFACES-3321.
----------------------------------
Resolution: Fixed
Fix Version/s: 2.1.4-SNAPSHOT
2.0.10-SNAPSHOT
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
> Fix For: 2.0.10-SNAPSHOT, 2.1.4-SNAPSHOT
>
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) jsf.js: Script fragments
evaluated after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115288#comment-13115288 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
Another thing I noticed, jsf.js is reloaded, this should not happen according to the code.
I will investigate into that as well.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) jsf.js: Script fragments
evaluated after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115285#comment-13115285 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
Ok the example Leo gave me triggering this issue causes an internal error in the javascripts exposing itself as error message in jsf.js. I have yet to debug into this error, but I assume it is the mentioned problem of a script eval failing.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (MYFACES-3321) jsf.js: Script
fragments evaluated after an ajax operation encode '&' character into
'&'
Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114640#comment-13114640 ]
Werner Punz edited comment on MYFACES-3321 at 9/26/11 1:01 PM:
---------------------------------------------------------------
This is not a bug, per se, the problem there is that the innerHTML of the browser itself issues the replacement, I am not even sure if it just does not replace simply & issued by innerHTML commands within the evaled scripts. I will try to find a workaround to this issue.
was (Author: werpu):
This is not a bug, per se, the problem there is that the innerHTML of the browser itself issues the eval. I will try to find a workaround to this issue.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (MYFACES-3321) jsf.js: Script fragments evaluated
after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Resolved) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Werner Punz resolved MYFACES-3321.
----------------------------------
Resolution: Fixed
i now have switched to the parsing code for the content and only revert to the xml code for the attributes parsing
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
> Fix For: 2.0.10-SNAPSHOT, 2.1.4-SNAPSHOT
>
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) jsf.js: Script fragments
evaluated after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115300#comment-13115300 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
The double import was caused by a check for jsf.js which did only executed half the code it should, I now have changed the code accordingly, so that it imports jsf.js only if it is not present in the window namespace (which is basically never unless someone causes such a condition manually)
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (MYFACES-3321) jsf.js: Script
fragments evaluated after an ajax operation encode '&' character into
'&'
Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114640#comment-13114640 ]
Werner Punz edited comment on MYFACES-3321 at 9/26/11 1:06 PM:
---------------------------------------------------------------
This is not a bug. The only time this happens in my testcases here is whenever a innerHTML is issued from the script itself with an & sign. And there the browser simply has this behavior. Normal & are not affected.
aka
<script>
node.innerHTML = "bla & bla" results in bla & bla due to browser behavior regarding innerHTML
</script>
<script>
true && true;
</script>
will show up in the browser as final result true && true
was (Author: werpu):
This is not a bug, per se, the problem there is that the innerHTML of the browser itself issues the replacement, I am not even sure if it just does not replace simply & issued by innerHTML commands within the evaled scripts. I will try to find a workaround to this issue.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) jsf.js: Script fragments
evaluated after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116442#comment-13116442 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
The issue is that the new serialisation code produces wrong results for non javascript elements.
I personally think the only viable option simply is to revert to a parsing for the body and a full innerHTML.
Everything else does not work out.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
> Fix For: 2.0.10-SNAPSHOT, 2.1.4-SNAPSHOT
>
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) jsf.js: Script fragments
evaluated after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114640#comment-13114640 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
This is not a bug, per se, the problem there is that the innerHTML of the browser itself issues the eval. I will try to find a workaround to this issue.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (MYFACES-3321) jsf.js: Script fragments evaluated
after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Reopened) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Werner Punz reopened MYFACES-3321:
----------------------------------
The bugfix opened another bug. Now deeper elements in replace body and head are ignored entirely. We have to work differently here.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
> Fix For: 2.0.10-SNAPSHOT, 2.1.4-SNAPSHOT
>
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (MYFACES-3321) jsf.js: Script fragments
evaluated after an ajax operation encode '&' character into '&'
Posted by "Werner Punz (Commented) (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-3321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13115323#comment-13115323 ]
Werner Punz commented on MYFACES-3321:
--------------------------------------
Ok the root cause of this problem, and it only can happen in the head replacement code is following.
a) Browsers do not allow a direct head replacement.
b) Instead the head is more or less generated and then parsed by an xml construct (and if not a direct head replacement is tried). The xml construct parses the code as xml and during this parsing step a deserialize xml is called to get the script text data. This works but it encodes & into amp, now, we do not need that for script tags in most cases, a simple xml.text should suffice which does not encode the &. So I will add the xml.text as fallback if present, this should resolve the issue.
The normal update cases are not touched by this issue, hence it has not crawled up so far.
> jsf.js: Script fragments evaluated after an ajax operation encode '&' character into '&'
> --------------------------------------------------------------------------------------------
>
> Key: MYFACES-3321
> URL: https://issues.apache.org/jira/browse/MYFACES-3321
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-314
> Reporter: Leonardo Uribe
> Assignee: Werner Punz
>
> Script fragments containing & characters are encoded into & before the script is evaluated. I checked the code from the server side and it is correct, so the problem is on the javascript part.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira