Just see the code snippet of SpringMVC-3.2.x controller action method. Its quite easy to generate JSON but unable to add addtional custom header only f
SpringMVC-3.2.x
JSON
Here is the solution as the suggestion of M. Deinum
@RequestMapping(value="ajaxSuccess", method = RequestMethod.GET) public ResponseEntity> ajaxSuccess(){ Map message = new HashMap(); message.put("severity", "info"); message.put("location", "/"); message.put("summary", "Authenticated successfully."); message.put("code", 200); Map json = new HashMap(); json.put("success", true); json.put("message", message); HttpHeaders headers = new HttpHeaders(); headers.add("Content-Type", "application/json; charset=UTF-8"); headers.add("X-Fsl-Location", "/"); headers.add("X-Fsl-Response-Code", "302"); return (new ResponseEntity>(json, headers, HttpStatus.OK)); }