[ 
https://issues.apache.org/jira/browse/MYFACES-2585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841464#action_12841464
 ] 

Werner Punz commented on MYFACES-2585:
--------------------------------------

Actually I do not think CDATA removal alone is really the solution, Mojarra 
does it and fails in corner cases (which I expected), it is a solution which 
works for 98% of all cases, like I pointed out
mojarra gehts into trouble with  alert("<![CDATA[hello]]>");  while facelets 
allows it.
I have not even tested for a commented comment tag outside of between ]]> and 
</script>

Since we do not run through facelets after ppr we probably should opt for an 
encoding of the entire content (including or excluding the cdata) and decoding 
it
if it is encoded, like I pointed out before.
This could be done with a little bit of extra effort and a small performancehit 
on the ppr responsewriter level and javascript level.

Sorry that I am that insistent on the encoding step (base64 or something else) 
because the way I see it if we encode everything within the <update...> 
</update> tag content we can cover 100% of all cases without semantic 
understanding and and sideffects. The only sideffect I see is that the mojarra 
scripts will fail on myfaces while we still will be backwards compatible to 
Mojarra as server side implementation.





> ajax doesn't work if target contains script with CDATA
> ------------------------------------------------------
>
>                 Key: MYFACES-2585
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2585
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-2
>         Environment: Javascript, API, IMPL...
>            Reporter: Ganesh Jung
>            Priority: Critical
>
> This doesn't work:
>               <h:inputText value="#{numberBean.myNumber}">
>                               <f:ajax render="test" />
>               </h:inputText>
>               <h:panelGroup id="test">
>                           <script type="text/javascript">
>                               //<![CDATA[
>                                       alert("running");
>                                       //]]>
>                               </script>
>                       <h:inputText value="#{numberBean.myNumber}" />
>               </h:panelGroup>
> But this works fine:
>               <h:inputText value="#{numberBean.myNumber}">
>                               <f:ajax render="test" />
>               </h:inputText>
>               <h:panelGroup id="test">
>                           <script type="text/javascript">
>                                       alert("running");
>                               </script>
>                       <h:inputText value="#{numberBean.myNumber}" />
>               </h:panelGroup>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to