How to migrate struts 1 select tag with dynamic option tag to struts 2

251 Views Asked by At

I have one .tag file which I am using inside my jsp.

<html:select size="5" multiple="true" style="width:150px"    
                styleClass="listBoxHeader searchField"
                styleId="searchField${fieldCount}" 
                property="values(${field.name})"
                disabled="${disabled}">
    <c:forEach var="litem" items="${field.selectValueEntries}">
        <html:option value="${litem.key}">
            <fmt:message var="temp" key="${litem.value}" />
               <c:choose>
                   <c:when test="${fn:startsWith(temp,'???')}">
                      <c:out value="${litem.value}"/>
                   </c:when>
                   <c:otherwise><c:out value="${temp}"/>
                   </c:otherwise>
               </c:choose>
       </html:option>
    </c:forEach>
</html:select>

Here I have populated the select option using a loop and some condition. This is a .tag file. How to migrate this code using struts 2 select tags.

0

There are 0 best solutions below