cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sudhi <sudheen...@insage.com>
Subject Re: Using <response:url-encode> ...
Date Tue, 11 Jul 2000 15:27:27 GMT
Hi,
U can encode url in so many ways. 
By calling encodeUrl method in response object in your xsp page.
A few days back I saw a post may be this is what u need. I am pasting it
here...
----------------------------------------
On Sun, 25 Jun 2000, Zvi wrote:

> Donald,
> 
> but how I can access request object from Xalan extension? I tried to
> modify Cocoon source and pass it as XSLT parameter, but this doesn't
> worked.


why do you need to mess with a request object? as i understand it,
you're
generating a bunch of data from an sql query, then you want to generate
links with request parameters that contain special characters that need
to
be encoded. yes? so call java.net.URLEncoder.encode from your XSLT
stylesheet like this:

<xsl:value-of select="java:java.net.URLEncoder.encode($url)"/>

see http://xml.apache.org/xalan/extensions.html#java-namespace

for more information on this shortcut.

If you need to access request parameters in your XSLT page, simply
declare
them:

<xsl:param name="foo"/>

and reference them using $foo. am i missing something?

- donald
----------------------------------------


> I guess in order to generate an <a href=".."> element again, I will have
> to encode the url passed to the href attribute. And that's exactly where
> I am stuck ... :-(. The response taglib apparently specifies an
> <response:url-encode> element (with the matching template rule in the
> logicsheet), but where I the above chain would I have to use it.
> 


HTH
Sudhi

Mime
View raw message