myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: URL encoding the value of outputLink?
Date Mon, 11 Sep 2006 19:43:42 GMT
If it were me, I'd create a facelets function.   URLEncoder already
provides a static method for you to hook into it, so it's just a
matter of adding a taglib entry -- no code.

http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html

On 9/11/06, Dave Brondsema <dave@brondsema.net> wrote:
>
> The MyFaces implementation of outputLink URL-encodes the parameters, but
> not the value.  This seems correct according to the spec's javadocs for
> outputlink.
>
> So is there an easy way to URL-encode the value of the outputLink?  I
> loop through a List and display the file name as text and also use the
> file name in the outputLink.  But sometimes the file name includes a '#'
> or special character that needs to be URL-encoded.
>
> All I can think of now is writing an extended version of h:outputLink
> with a encodeValue attribute.  Or come up with an EL function to do it,
> possibly using http://wiki.apache.org/myfaces/Parameters_In_EL_Functions.
>
> Are there any better solutions?
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>

Mime
View raw message