I am using play framework for java and want to learn form submission. So I have this method in my controller:
public Result index(String url) {
Form<SimpleUser> userForm = Form.form(SimpleUser.class);
Map<String,String> anyData = new HashMap();
anyData.put("name", "hossein");
SimpleUser user = userForm.bind(anyData).get();
return ok(views.html.index.render(user.getName()));
}
The problem is that the line containing "SimpleUser user = userForm.bind(anyData).get();" gives error :
java: cannot access org.codehaus.jackson.JsonNode class file for org.codehaus.jackson.JsonNode not found
The class SimpleUser definition:
public class SimpleUser {
protected String name;
public void setName(String name) {this.name = name;}
public String getName() {return name;}
}
Actually this error confuses me because I don't know what does it have with JsonNode. Why this error occurs and how can I fix it?
Thanks a lot!