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

  • Escaping in form:options

    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"/>

    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}
    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!