Announcement Announcement Module
Collapse
No announcement yet.
Escaping in form:options Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Escaping in form:options

    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!
Working...
X