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