title: Binding modelAttribute from jsp to controller
body: <p>This is my Controller class:</p>
  
  <pre><code>@Controller
  @SessionAttributes({"list", "selectedCompany"})
  public class ProspectController {
  
  protected static Logger logger = Logger.getLogger("controller");
  
  @Resource(name = "ProspectWebServiceTemplate")
  private WebServiceTemplate prospectWebServiceTemplate;
  @Resource(name = CountryWebServiceTemplate")
  private WebServiceTemplate countryWebServiceTemplate;
  @Resource(name = "CompanyWebServiceTemplate")
  private WebServiceTemplate companyWebServiceTemplate;
  
  /**
   * Handles and retrieves the subscribe page
   */
  @RequestMapping(value = "/addProspect", method = RequestMethod.GET)
  public String getAddProspectPage(@ModelAttribute("prospectAttribute") ProspectDto prospectDto,Model model) {
      logger.debug("Received request to show add prospect page");
  
      final GetAllCountriesRequest request = new GetAllCountriesRequest();
      GetAllCountriesResponse response = (GetAllCountriesResponse) countryWebServiceTemplate
              .marshalSendAndReceive(request);
  
  
      List&lt;CountryDto&gt; list = new ArrayList&lt;CountryDto&gt;();
      List&lt;CountryDto&gt; allCountries =  response.getCountriesDto();
      if (response != null &amp;&amp; allCountries != null) {
          for (CountryDto dto : allCountries) {
              list.add(dto);
          }
      }
  
      model.addAttribute("list", list);
  
      final GetAllCompaniesRequest requestComp = new GetAllCompaniesRequest();
      GetAllCompaniesResponse responseComp = (GetAllCompaniesResponse) companyWebServiceTemplate
              .marshalSendAndReceive(requestComp);
  
      List&lt;CompanyDto&gt; listComp = new ArrayList&lt;CompanyDto&gt;();
      List&lt;CompanyDto&gt; allCompanies =  responseComp.getCompaniesDto();
      if (responseComp != null &amp;&amp;  allCompanies != null) {
          for (CompanyDto dto : allCompanies) {
              listComp.add(dto);
          }
      }
      model.addAttribute("listComp", listComp);
  
  
  
      model.addAttribute("prospectAttribute", new SaveProspectRequest());
      return "addProspect";
  }
  
  
  @RequestMapping(value = "/saveProspect", method = RequestMethod.POST)
  public String doSave(
          @ModelAttribute("prospectAttribute")  SaveProspectRequest request,
          Model model) {
      logger.debug("Received request to subscribe");
      try {
          SaveProspectResponse response = (SaveProspectResponse) prospectWebServiceTemplate
                  .marshalSendAndReceive(request);
          logger.debug(response.getId());
  
          model.addAttribute("response", "Success! ");
          model.addAttribute("prospect", response.getFirstName());
  
      } catch (SoapFaultClientException sfce) {
          logger.error("We sent an invalid message", sfce);
          model.addAttribute("error",
                  "Validation error! We cannot process your subscription");
  
      } catch (Exception e) {
          logger.error("Unexpected exception", e);
          model.addAttribute("error",
                  "Server error! A unexpected error has occured");
      }
  
      model.addAttribute("prospectAttribute", request);
  
      return "addProspect";
  }
  </code></pre>
  
  <p>}</p>
  
  <p>This is my jsp file</p>
  
  <pre><code>    &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
      &lt;%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%&gt;
      &lt;%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%&gt;
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
    &lt;html&gt;
   &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
    &lt;title&gt;Prospect&lt;/title&gt;
    &lt;/head&gt;
  
   &lt;body&gt;
  
  &lt;c:url var="addUrl" value="/example/saveProspect" /&gt;
  &lt;form:form modelAttribute="prospectAttribute" method="POST"
      action="${addUrl}"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.firstName"&gt;First Name:&lt;/form:label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;form:input path="prospectDto.firstName" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.lastName"&gt;Last Name:&lt;/form:label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;form:input path="prospectDto.lastName" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.function"&gt;Function:&lt;/form:label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;form:input path="prospectDto.function" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.email"&gt;Email:&lt;/form:label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;form:input path="prospectDto.email" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.telephone"&gt;Telephone:&lt;/form:label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;form:input path="prospectDto.telephone" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.typeLead"&gt;Type Lead:&lt;/form:label&gt;&lt;/td&gt;
              &lt;td&gt;&lt;form:select path="prospectDto.typeLead"&gt;
                      &lt;form:option value=""&gt;-- Select Type Lead --&lt;/form:option&gt;
                      &lt;form:option value="LEAD1"&gt;LEAD1&lt;/form:option&gt;
                      &lt;form:option value="LEAD2"&gt;LEAD2&lt;/form:option&gt;
                      &lt;form:option value="LEAD3"&gt;LEAD3&lt;/form:option&gt;
                      &lt;form:option value="CLIENT"&gt;CLIENT&lt;/form:option&gt;
                      &lt;form:option value="REFUSE"&gt;REFUSE&lt;/form:option&gt;
                  &lt;/form:select&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;form:label path="prospectDto.company"&gt;Company:&lt;/form:label&gt;&lt;/td&gt; 
              &lt;td&gt;&lt;form:select path="prospectDto.company"&gt; 
                          &lt;form:option value=""&gt;-- Select Company --&lt;/form:option&gt; 
                          &lt;c:forEach items="${listComp}" var="company"&gt; --%&gt;
                              &lt;form:option value="${company.id}"&gt;${company.name}&lt;/form:option&gt; 
                          &lt;/c:forEach&gt; 
              &lt;/form:select&gt;&lt;/td&gt; 
  
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td colspan="4"&gt;&lt;input type="submit" value="AddProspect"
                  /&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form:form&gt;
   &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I have a company list which is in controller class and when i send it to the jsp file it works. But, in browser, when i select a company from combobox, it should  send to the  "doSave" method of controller class a modelAttribute of type Prospect that contains the Company but it doesn't work! 
  What could be the problem?</p>