title: How to bind subclass object in spring form submit as modelAttribute
body: <p>I Have </p>
  
  <pre><code>Class Shape {
        //Implementation
  }
  Class Round extends Shape{
        //Implementation
  }
  </code></pre>
  
  <p>Controller
  I Have</p>
  
  <pre><code>@Requestmapping(value="/view/form")
  public ModelAndView getForm(){
  ModelAndView mav=new ModelAndView();
  mav.addObject("shape",new Round());
  }
  
  
  @RequestMapping(value="/submit", method = RequestMethod.POST)    
  public ModelAndView submitForm(@ModelAttribute("shape") Shape shape){
           if(shape instanceof Round){ //**Not giving positive result**
  
           }
      }
  </code></pre>
  
  <p>in Jsp</p>
  
  <pre><code>&lt;form:form action="/submit" commandName="shape" method="post"&gt;
  
  //form tags
  
  &lt;/form:form&gt;
  </code></pre>
  
  <p>when I submit the form with Round object. At controller side ModelAttribute is not giving instance of Round . its giving instance of shape only. How to do this</p>