title: data binding to drop down box in Spring MVC
body: <p>I have simple spring mvc web application.I want to bind list into drop down.In this case list items are normally bind into drop down; but If I select item and click submit button it is always passing "0" instead of value.</p>
  
  <h2>This is my controller.</h2>
  
  <pre><code>public EditEmployeeController() {
          setCommandClass(Employee.class);
          setCommandName("employee");
  }
  
  @Override
  protected Map referenceData(HttpServletRequest request) throws Exception {
      Map referenceData = new HashMap();        
      List roleList = roleService.listRoles();
      referenceData.put("roleList", roleList);
      return referenceData;
  }
  
  @Override
  protected ModelAndView onSubmit(HttpServletRequest request,
          HttpServletResponse response,
          Object command,
          BindException errors) throws Exception {
      Employee employee = (Employee) command;
      employeeService.updateEmployee(employee);
      return new ModelAndView(getSuccessView());
  }
  </code></pre>
  
  <p>This is my view(jsp)</p>
  
  <pre><code>&lt;c:nestedPath path="employee"&gt;
              &lt;form method="post" action="./EditEmployee.htm"&gt;
  ........
  .......
  
  Select Role :                
  &lt;c:bind path="roleID"&gt;
   &lt;select name="roleLists"&gt;
     &lt;s:forEach items="${roleList}" var="role" &gt;
         &lt;option value="&lt;s:out value="${role.roleID}"/&gt;" &lt;s:if test="${role.roleID == status.value}"&gt; selected="selected"&lt;/s:if&gt;&gt;&lt;s:out value="${role.title}"/&gt;&lt;/option&gt;
          &lt;/s:forEach&gt;
    &lt;/select&gt;
  &lt;/c:bind&gt;
  &lt;input type="submit" value="Update employee"/
  &lt;/form&gt;
  &lt;/c:nestedPath&gt;
  </code></pre>
  
  <p>Any idea for solve my problem..??</p>
  
  <p>Thank in advance!</p>