cht
Jun 8th, 2006, 04:49 AM
Hi!
Is there a way to escape the output from the form:options tag?
I have the code:
<form:select path="selectedContact">
<form:options items="${contactList}" itemLabel="displayName" itemValue="sip"/>
</form:select>
The problem is that the label (displayName) can contain characters that need to be escaped. I have tried setting the
<spring:htmlEscape defaultHtmlEscape="true" />
but this doesnt help me. There is always the workaround to do it, for example, like this:
<c:forEach items="${contactList}" var="contact">
<option value="${contact.sip}">
<spring:escapeBody htmlEscape="true"> ${contact.displayName}
</spring:escapeBody>
</option>
</c:forEach>
or with c:url...
Although it would be neat if there is some way to solve it with the options tag so the code is kept to a minimum.
Thanks in advance!
Is there a way to escape the output from the form:options tag?
I have the code:
<form:select path="selectedContact">
<form:options items="${contactList}" itemLabel="displayName" itemValue="sip"/>
</form:select>
The problem is that the label (displayName) can contain characters that need to be escaped. I have tried setting the
<spring:htmlEscape defaultHtmlEscape="true" />
but this doesnt help me. There is always the workaround to do it, for example, like this:
<c:forEach items="${contactList}" var="contact">
<option value="${contact.sip}">
<spring:escapeBody htmlEscape="true"> ${contact.displayName}
</spring:escapeBody>
</option>
</c:forEach>
or with c:url...
Although it would be neat if there is some way to solve it with the options tag so the code is kept to a minimum.
Thanks in advance!