title: i Can not save the foreign key in Spring mvc form select tag
body: <p>I'm trying to save a form that has a foreign key in select tag but it's always null. !</p>
  
  <p>class user :</p>
  
  <pre><code>@Entity
  public class User implements Serializable{
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long UserCode;
      private String Lastname;
      private String Firstname;
      private String Adress;
      @ManyToOne
      @JoinColumn(name="CityCode")
      private City CityCode;
      private String phone;
      private String mail;
      private int newsletter; 
  </code></pre>
  
  <p>controller :</p>
  
  <pre><code>@RequestMapping(value = "/add", method = RequestMethod.POST)
          public String add(@ModelAttribute("userModel") User user,BindingResult bindingResult, Model model) {    
              user.setCreator("admin");
              user.setDateCreation(new Date());
              user.setDateChange(new Date());
  
              model.addAttribute("user", new User());
              metier.AddUser(user);
  
              return "redirect:/user";
          }
  </code></pre>
  
  <p>code html :</p>
  
  <pre><code>&lt;div class="form-group"&gt;
  &lt;label for="city" class="control-label col-lg-2"&gt;Ville&lt;/label&gt;
    &lt;div class="col-lg-4"&gt;
       &lt;f:select path="CityCode" class="control-label col-lg-12"&gt;
          &lt;c:forEach items="${states}" var="state"&gt;
              &lt;option value="${state.cityCode }"&gt;${state.name }&lt;/option&gt;                                                  
          &lt;/c:forEach&gt;
      &lt;/f:select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>i cant save city code in table user </p>