json - data binding from jsp to controller spring mvc model has list as a atribute -


i tried way, still methods not initialized , gives null.

//model class set attribute

 @onetomany(cascade = cascadetype.all, mappedby = "customer", fetch = fetchtype.eager)     private set<paymentmethod> methods; 

//jsp form

      <input type="checkbox" name="customer.methods[0].type" value="cc">credit card<br>       <input type="checkbox" name="customer.methods[1].type" value="dc">debit card<br>       <input type="checkbox" name="customer.methods[2].type" value="pp">pay pal<br>       <input type="checkbox" name="customer.methods[3].type" value="bc">bank credit     </div> 

you question quite hard understand, can tell @ first glance, you're trying access list if array isn't.

at least should customer.getmethods().get(0).gettype() , on.

the getters there clarity. of course entity has have getters , setters.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -