Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 91216 invoked from network); 29 May 2007 19:36:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 May 2007 19:36:11 -0000 Received: (qmail 56888 invoked by uid 500); 29 May 2007 19:36:04 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 56840 invoked by uid 500); 29 May 2007 19:36:04 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 56829 invoked by uid 99); 29 May 2007 19:36:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 12:36:04 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of jak-struts-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 May 2007 12:35:58 -0700 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ht7Ti-0001GN-Ms for user@struts.apache.org; Tue, 29 May 2007 21:35:34 +0200 Received: from cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com ([74.99.167.14]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 May 2007 21:35:34 +0200 Received: from laurie by cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 May 2007 21:35:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: user@struts.apache.org From: Laurie Harper Subject: Re: & characters are encoded as & in OGNL parameters Date: Tue, 29 May 2007 15:35:23 -0400 Lines: 32 Message-ID: References: <521768.39401.qm@web56706.mail.re3.yahoo.com> <1180359950.27660.2.camel@sdalouche1> <1180381636.30593.3.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: cpe0016b5ef7ea1-cm0014e88ef4b4.cpe.net.cable.rogers.com User-Agent: Thunderbird 1.5.0.10 (Macintosh/20070221) In-Reply-To: <1180381636.30593.3.camel@localhost.localdomain> Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Sami Dalouche wrote: > Hi, > >>> Is it possible to disable this behaviour somehow ? >> Depends how you're using the URL. Are you sure you even *want* to >> disable the behaviour? Encoding ampersands is generally the right thing >> to do. > > Well, yeah, I do want to disable it. > Basically, I need to generate the fully qualified (hostname, port, > context, action) URL of the current page (with different parameters), so > that I can encode it (using URLEncoder), append it to > http://maps.google.com/q={myUrl} > > The problem is that URLEncoder WILL encoder & correctly, so I don't want > struts to process it before I do. > > So, is it possible to disable this & encoding ? Hmm, well, you haven't described how you're using the url produced with the s:url tag other than 'reusing the url #id in some OGNL parameter'; that's a bit vague. Assuming you're using OGNL to pass the URL value to a method you've written, you can pre/post process the value any way you want. The s:url tag has an 'encode' attribute to control whether the URL should be encoded [1], which is true by default. Perhaps all you need is to set that appropriately. L. [1] http://struts.apache.org/2.x/docs/url.html --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org