You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by "Vianen, Jeroen van" <je...@satama.com> on 2003/10/07 13:07:39 UTC

Feature request in ?

To be able to write correct (X)HTML ampersands in attribute values have to
be escaped. To do so with JSTL, I use the following code:

<c:set var="a" value="A"/>
<c:set var="b" value="B"/>
<c:url var="theUrl" value="whatever.jsp">
	<c:param name="a" value="${a}"/>
	<c:param name="b" value="${b}"/>
</c:url>
<a href="<c:out value="${theUrl}" escapeXml="true"/>">Link to whatever</a>

This will return a correctly XML / XHTML escaped URL:

<a href="whatever.jsp?a=A&amp;b=B">...</a>

Would it be possible in a future version of the JSTL to combine these two
tags as follows:

<c:url value="whatever.jsp" escapeXml="true">
	<c:param name="a" value="${a}"/>
	<c:param name="b" value="${b}"/>
</c:url>

What do you think?


Jeroen

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org