Answer the question
In order to leave comments, you need to log in
Why doesn't bindFromRequest find a field with a camelCase name?
These are the oddities that happened when parsing the request and converting it into a class object using bindFromRequest
public class Some {
public boolean isActive = false;
}
Form<Some> form = Form.form(Some.class).bindFromRequest();
Form.form().bindFromRequest().get("isActive");// OK, видит поле и оно true
form.isActive;// а вот это как было false, так и осталось
<input name="isActive" value="true" type="checkbox"> Is Active
Answer the question
In order to leave comments, you need to log in
After several errors of unknown origin, I discovered that bindFromRequest changes class data through setters, guided by the name of the method, not the object.
That is, if he received a request -> isActive, then he will look for the setIsActive method
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question