Using Play Framework, you can do something like this:
public static void mymethod() {
// do stuff here
MyModel mymodel = new MyModel();
Binder.bindBean(params.getRootParamNode(), "mymodel", mymodel);
// equivalent to specifying this in the method params :
// mymethod (@Valid MyModel mymodel)
}
But that would require that you send your params as "mymodel.name", "mymodel.title", etc (with name & title in the model).
What I'd like to do is getting rid of the "mymodel." in the params, just sending "name", "title", and bind them directly to my model.
I know I can't do that with @Valid (well, as far as I know), but I tried something like this, and it didn't work :
Binder.bindBean(params.getRootParamNode(), "", mymodel); // Nothing between quotes
I know this is possible, I found it before but can't put my finger on it now, could you help me please?
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)