From dev-return-61230-apmail-struts-dev-archive=struts.apache.org@struts.apache.org Mon Nov 16 18:37:46 2009 Return-Path: Delivered-To: apmail-struts-dev-archive@www.apache.org Received: (qmail 29110 invoked from network); 16 Nov 2009 18:37:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Nov 2009 18:37:46 -0000 Received: (qmail 49959 invoked by uid 500); 16 Nov 2009 18:37:45 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 49903 invoked by uid 500); 16 Nov 2009 18:37:45 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 49893 invoked by uid 99); 16 Nov 2009 18:37:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 18:37:45 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of musachy@gmail.com designates 209.85.160.48 as permitted sender) Received: from [209.85.160.48] (HELO mail-pw0-f48.google.com) (209.85.160.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Nov 2009 18:37:37 +0000 Received: by pwj12 with SMTP id 12so3983494pwj.27 for ; Mon, 16 Nov 2009 10:37:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=OiudYHdJcj+KvdF4F6cjVdETegThyGia5Zqu04AtfDk=; b=lrocZLE/cvQ+ypw52cWFhyRgRvpM548Fdl0IJ0QVyEWuWC0K5Jh28fIbn44XQ1pykz 5wCAaysKeF1UopjPwBZDZT9EaIPeLhIyL+Sbl5MiYnPBC3TjywpKt3P2jUH3A1jVUmzl ZarHW2PaqFidUR4FWHXJDIP/XcaiesjwCmwVg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=UZrfIpdVMHBsoejR2B1ZU3sDZqT+2w4xmsxootxAxJmX6yL4kyj6ssjhCnPmz8auev jvTVpKRfI4cPdk4K8mmSYAQgQNJyD+7f3wLxqDDZftMehWaMWE95+y2oYm/7VuU4c8ha d6q16dY4+ZO+OOIdXUC0hlM+jQnXwqC8FaqJo= MIME-Version: 1.0 Received: by 10.115.103.26 with SMTP id f26mr8571801wam.198.1258396635913; Mon, 16 Nov 2009 10:37:15 -0800 (PST) In-Reply-To: References: <148284FF-0B5F-46C6-A693-F9D8C003ACFC@lovtangen.com> Date: Mon, 16 Nov 2009 10:37:15 -0800 Message-ID: Subject: Re: 2.1.8.1: Change in escaping From: Musachy Barroso To: Struts Developers List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org it is in trunk now. Please note that "escape" is true by default, so to escape some xml you should do: hum, I wonder if we should deprecate "escape" and add a new "escapeHtml"? musachy On Mon, Nov 16, 2009 at 10:15 AM, Musachy Barroso wrote= : > working on it, it will be in trunk soon. > > On Mon, Nov 16, 2009 at 10:11 AM, Ronny L=F8vtangen = wrote: >> Thanks for creating the jira issue. An escapeXml property would be reall= y useful. >> Agree that "htmlEncode" was a misleading name. >> >> Ronny >> >> On Nov 16, 2009, at 6:48 PM, Musachy Barroso wrote: >> >>> hum, that's interesting. This move was to remove custom code by code >>> in commons. The misleading part is that the method was called >>> "htmlEncode". We should add an attribute to to the "property" tag >>> "escapeXml" that calls >>> org.apache.commons.lang.xwork.StringEscapeUtils.escapeXml(..), and >>> while we are at it, a "escapeCsv" as well. >>> >>> https://issues.apache.org/struts/browse/WW-3332 >>> >>> musachy >>> >>> On Mon, Nov 16, 2009 at 2:08 AM, Ronny L=F8vtangen wrote: >>>> >>>> When using escape=3D"true" (which is default) on I = can see that 2.1.6 and 2.1.8.1 behaves differently. >>>> E.g. the norwegian letter =F8 is escaped as ø in 2.1.6, but now i= n 2.1.8.1 it is escaped as ø >>>> >>>> I looked at the source. The change is that org.apache.struts2.componen= ts.Property now do a >>>> >>>> org.apache.commons.lang.xwork.StringEscapeUtils.escapeHtml(result) >>>> >>>> while it earlier did a >>>> >>>> com.opensymphony.xwork2.util.TextUtils.htmlEncode(result) >>>> >>>> I didn't find the source to org.apache.commons.lang.xwork.StringEscape= Utils. It is part of xwork-core-2.1.6.jar, but the source is not included i= n xwork-core-2.1.6-sources.jar (!) >>>> Is this the same class as org.apache.commons.lang.StringEscapeUtils in= commons-lang? If so, I can see that it uses a lookup table to escape html = entities, and fallbacks to #-escaping if not found. >>>> >>>> >>>> Is this change intentional? And is there a way to escape 'the old way'= ? My ouput is not for use in HTML, but as xml input to a flash component, s= o ø won't work. >>>> >>>> >>>> Regards, >>>> Ronny >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org >>>> For additional commands, e-mail: dev-help@struts.apache.org >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org >>> For additional commands, e-mail: dev-help@struts.apache.org >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org >> For additional commands, e-mail: dev-help@struts.apache.org >> >> > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org