title: Spring MVC form valiadtion with @NotEmpty annotation, one POJO with Multiple forms
body: <p>I am working on spring mvc with annotations. </p>
  
  <p>I have a POJO with three fields <strong>userName, password and mailId</strong> which are annotated as <strong>@NotEmpty</strong>. 
  I have two forms : </p>
  
  <ol>
  <li><code>Loginform.jsp</code> : contains two input fields userName and password. </li>
  <li><code>Forgotpassword.jsp</code>: contains only one input field mailId. </li>
  </ol>
  
  <p>The problem is if I use the same pojo for both jsp forms it's giving me binding result errors, as for login.jsp I don't need mailId, and for forgotpassword.jsp I don't need userName and password, but all these fields are annotated as <code>@NotEmpty</code> in my POJO,so gives validation error.</p>
  
  <p><strong>Q: How to deal with the situation? Do I need to create separate POJO for each Form?</strong></p>