Return POJO as JSON in Spring MVC 4
<p>I have a very simple object, that i want to return as JSON</p>

<pre><code>public class Event {

    private String store;
    private Date date;
    private double fee;
    private String kit;
    private String information;
</code></pre>

<p>and a test controller as follows</p>

<pre><code>@RestController
@EnableWebMvc
public class UserController {

    @RequestMapping(value = "/user/{username}", method = RequestMethod.GET, produces = "application/json", headers="Accept=*/*")
    @ResponseBody
    public Event getUser(@PathVariable("username") String username){

        Event event = new Event("dummy", new Date(), 4.0, "dummy", "dummy");
        return event;
    }

}
</code></pre>

<p>I get "The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers."</p>

<p>My servlet has only this entry</p>

<pre><code>&lt;mvc:annotation-driven /&gt;    
</code></pre>

<p>How can i achieve the desired output?</p>