Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 21451 invoked from network); 7 Mar 2010 15:50:11 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Mar 2010 15:50:11 -0000 Received: (qmail 83277 invoked by uid 500); 7 Mar 2010 15:49:50 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 83227 invoked by uid 500); 7 Mar 2010 15:49:50 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 83220 invoked by uid 99); 7 Mar 2010 15:49:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Mar 2010 15:49:50 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Mar 2010 15:49:48 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 64A2C234C4A9 for ; Sun, 7 Mar 2010 15:49:27 +0000 (UTC) Message-ID: <732685681.125661267976967411.JavaMail.jira@brutus.apache.org> Date: Sun, 7 Mar 2010 15:49:27 +0000 (UTC) From: "Jan-Kees van Andel (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Commented: (MYFACES-2585) ajax doesn't work if target contains script with CDATA In-Reply-To: <425878557.61851267694427388.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MYFACES-2585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12842440#action_12842440 ] Jan-Kees van Andel commented on MYFACES-2585: --------------------------------------------- I'm just looking at it from the side, but isn't the issue that there is some fixed CDATA block (the outermost one), which may contain arbitrary HTML (possibly containing CDATA blocks)? There's nothing wrong with the CDATA on itself. It goes wrong when it's being marshalled another CDATA block. So that's where I would put (the first part of) the fix. For example, by overriding (if allowed by the TCK) the write() method in PartialResponseWriter to encode the CDATA end tag in some way. When encoded, the JavaScript only needs to decode all content in the CDATA blocks. If conform spec, it should be compatible with Mojarra and frameworks should not see any difference. Any nesting deeper than one level is an error of the developer/component-author and I don't think we should anticipate on this. So actually I'm saying we need to do any encoding exactly at the point where the content is being written to the response. Before is impossible, after is cumbersome. The write() method could also be put into the impl, but I think it then needs to become smarter, containing some state whether or not the content needs to be encoded. Overriding write() in PartialResponseWriter is possibly the easiest approach since you can assume all content needs to be encoded. But again, I'm just looking at it from the sideline and I might not see all details here. Just trying to look at it from a fresh angle. ;-) > 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: > > > > > > > > But this works fine: > > > > > > > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.