Re: JSTL 1.1.2 c:url problem?
"Trenton D. Adams" <[email protected]>
| Newsgroups | gmane.comp.jakarta.taglibs.user |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the tip.
Just out of curiosity, is JSTL supposed to do encoding by default?
Rashmi Rubdi wrote:
> 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 <[email protected]>
> 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]%3e
>
> It's not a problem to build your own patched jstl version.
>