Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play framework 2.4 form fill does not work

In Play Framework 2.4 Java, I need to fill a form using the following code, but it does not work. The output value of usereditform.field("email").value() is null. Anyone know why?

SignupClz signupobj = new SignupClz();
signupobj.email="[email protected]";
signupobj.name="abcd";
signupobj.password = "eoijf";

Form<SignupClz> usereditform = Form.form(SignupClz.class).fill(signupobj);
System.out.println(usereditform.field("email").value());
like image 544
lingyan Avatar asked Oct 30 '22 15:10

lingyan


1 Answers

This code is correct. Please look at other points - maybe you did not recognize "[email protected]" output in the console.

For example I have the similar code and it works:

EditForm rawEditForm = new EditForm();
rawEditForm.title = boxModel.title;
rawEditForm.body = boxModel.body;
rawEditForm.id = id;

Form<EditForm>  editForm = Form.form(EditForm.class).fill(rawEditForm);
Logger.info("Title: " + editForm.field("title").value());
like image 176
Andriy Kuba Avatar answered Nov 15 '22 05:11

Andriy Kuba