Results 1 to 10 of 16

Thread: Spring JSON causes problems when the Spring framework is upgraded from 3.0.2 to 3.2.0

Threaded View

  1. #11
    Join Date
    Nov 2012
    Posts
    5

    Default

    Hi Kent,

    Thanks for your response...I had tried previously with produces ="application/json" and it didnt work. Also now i tried with

    Code:
    	@RequestMapping(method = RequestMethod.GET, value = { WebApplicationConstants.SWITCH_USER_URL },produces = "application/json;charset=UTF-8")
    Still am getting 406. Also I would like to tell you one more observation that we have made. The moment when I change the return type from an Object to a String, it works....
    Code:
    Existing:
    
    public @ResponseBody
    CustomResponse switchUser(
    @RequestParam(WebApplicationConstants.SESSION_TOKE N) String gsxSessionToken,
    @RequestParam(WebApplicationConstants.SWITCH_FLAG) String switchFlag,
    HttpServletRequest request,
    HttpServletResponse response,
    
    Return Type:
    return new CustomResponse(jsonObject.toString());
    
    New:
    )
    public @ResponseBody
    String switchUser(
    @RequestParam(WebApplicationConstants.SESSION_TOKE N) String gsxSessionToken,
    @RequestParam(WebApplicationConstants.SWITCH_FLAG) String switchFlag,
    HttpServletRequest request,
    HttpServletResponse response,
    
    
    Return Type:
    return (jsonObject.toString());

    But this involves changes across application and is not a recommended solution that we are looking for. Could you please let us know how we can tackle this error?
    Last edited by dinup; Jan 14th, 2013 at 11:23 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •