I am trying to setup a Spring MVC project. I have added a dispatcher servlet, a jsp and setup the web.xml file. But I keep getting
WARN org.springframew
I got that error when i migrated/updated from Spring framework 3.X to 4.X and using json (through Jackson2) as returned object and got the error above.
To solve that you should add
To XXX-servlet.xml file
And on the code you should use MappingJackson2JsonView as return value for example :
@RequestMapping("/user")
MappingJackson2JsonView user() {
MappingJackson2JsonView view = new MappingJackson2JsonView();
view.setExtractValueFromSingleKeyModel(true);
view.addStaticAttribute("user", new User("Sébastien", "Deleuze"));
view.setPrefixJson(true);
return view;
}
for more examples look here: http://www.programcreek.com/java-api-examples/index.php?api=org.springframework.web.servlet.view.json.MappingJackson2JsonView