Dependencies:
<jackson.version>2.6.4</jackson.version>
<jackson.mapper.version>1.9.13</jackson.mapper.version>
...
<!-- Jackson JSON -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.mapper.version}</version>
</dependency>
«Слушающий» метод контроллера:
public static class UserFromLogin {
public String id;
public String username;
public String email;
public String password;
public String password_control;
}
@RequestMapping(value = {"/user"}, method = RequestMethod.POST)
public @ResponseBody String createUser(@RequestBody UserFromLogin user) {
log.debug("CREATE USER: id="+user.id+", username="+user.username+", email="+user.email+", pass="+user.password+", passCheck="+user.password_control);
return "{data: 'ok'}";
}
В сервлете ничего не изменял. Может, нужно какой bean определить? Не могу нагуглить.