Issue with bindFromRequest in Play! Framework 2.3

前端 未结 6 1608
夕颜
夕颜 2021-01-12 01:37

I\'m trying to use the automatic binding feature of Play, without success. I\'m developing in Java, on Eclipse 4.4 Luna.

Here is my form :

6条回答
  •  甜味超标
    2021-01-12 01:48

    I solved this by Adding Setters and Getters. If you have Entity/Model class you should add setters and getters. If you have FormData classes add setters and getters for it as well.

    So when you call

    Form formData =       Form.form(YourFormData.class).bindFromRequest(); 
     YourFormData formData = formData.get(); 
    

    Your formData will now have all the values set. Hope this helps!

提交回复
热议问题