I am working on a task of migrating existing Struts1 application to Struts2. I am stuck in the problem. Within an <s:select>
I need to categories the options with <optgroup>
. The following code would do this in Struts1. How can I achieve this with Struts2?
<html:select id="foodList" property="foodItemId" onclick="selectRadio('0')">
<c:if test="${not empty foodList1}">
<optgroup label="Risk Analysis Report Sets">
<c:forEach var="item" items="${foodList1}">
<option value="${item.value}">${item.label}</option>
</c:forEach>
</optgroup>
</c:if>
<c:if test="${not empty foodList2}">
<optgroup label="NMX Report Sets">
<c:forEach var="item" items="${foodList2}">
<option value="${item.value}">${item.label}</option>
</c:forEach>
</optgroup>
</c:if>
<c:if test="${not empty foodList3}">
<optgroup label="Standard Report Sets">
<c:forEach var="item" items="${list3}">
<option value="${item.value}">${item.label}</option>
</c:forEach>
</optgroup>
</c:if>
</html:select>