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 <[EMAIL PROTECTED]> 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




Reply via email to