c:url by default doesn't encode the ampersand. 

However, there are options available in the current implementation of JSTL1.1 
which allows you to obtain an 
ampersand escaped URL.

1) In reference to the code you've mentioned, one option is:
<c:out var="link" escapeXml="true" />

So you'd essentially have a link like this <a href='<c:out var="link" 
escapeXml="true" />'> Link Text </a>

2) Here's a shorter option:
${fn:escapeXml(link)}

<a href='${fn:escapeXml(link)}'> Link Text </a>

This second option requires the functions Tag Lib. 
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>



-Rashmi

----- Original Message ----
From: Mikolaj Rydzewski <[EMAIL PROTECTED]>
To: Tag Libraries Users List <taglibs-user@jakarta.apache.org>
Sent: Monday, November 13, 2006 2:59:21 AM
Subject: Re: JSTL 1.1.2 c:url problem?


Trenton D. Adams wrote:
> Is c:url supposed to encode your ampersands?
Unfortunately not. I have raised such case a few weeks ago:

http://mail-archives.apache.org/mod_mbox/jakarta-taglibs-user/200609.mbox/[EMAIL
 PROTECTED]

It's not a problem to build your own patched jstl version.

-- 
Mikolaj Rydzewski <[EMAIL PROTECTED]>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to