cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: Building a query string with '&'....
Date Wed, 22 Nov 2000 06:08:37 GMT
FYI,

The following works:

<page>
	<!-- Build the URL ahead of time -->
	<xsp:logic>
		String myUrl = "http://localhost/folders/query-feeds.xml?QueryType="
				+ URLEncoder.encode(<request:get-parameter name="QueryType"/>)
				+ "<![CDATA[&QueryText=]]>"
				+ URLEncoder.encode(<request:get-parameter name="QueryText"/>)
				+ "<![CDATA[&QueryLog=]]>"
				+ URLEncoder.encode(<request:get-parameter name="QueryLog"/>);
	</xsp:logic>
    <util:include-uri>
        <util:href>
            <xsp:expr>myUrl</xsp:expr>
        </util:href>
    </util:include-uri>
</page>

Two things made a definite difference:
- moving the string concatenation out of the <util:href> tag. The reason is
that <util:include-uri> quotes the href element and this confuses the XSP
processor. Doing this and using CDATA around the expression &QueryText=
fixed the parsing problem

Then all of a sudden, QueryText parameters with spaces in them were accepted
to this XSP file but weren't passed on correctly to the remote host being
included

- correctly re-encoding the query args fixed that.

Per.


Mime
View raw message