Error to return JSON response for Spring MVC Post request to multiple user


I have the below controller method preparing a json response to jQgrid after a submit search request. No problem with Request/response if just one user works on search form but, it being abnormal when more than one user works simultaniously on the search form, the method render the response of the last search sended to the server =>As the result, the user 1 get the response of the second search by user 2.

Map<String,Csvfilecontent> searchForm = new HashMap<String,Csvfilecontent>();    
@RequestMapping(value="/submitsearchUmsatz", produces="application/json")
public JqgridResponse<Csvfilecontent> submitsearchUmsatz(HttpServletRequest request,
        @RequestParam(value="page", required=false) Integer page,
        @RequestParam("_search") Boolean search,
        @RequestParam(value="filters", required=false) String filters,
        @RequestParam(value="rows", required=false) Integer rows,
        @RequestParam(value="sidx", required=false) String sidx,
        @RequestParam(value="sord", required=false) String sord) throws ParseException
    Pageable pageRequest = new PageRequest(page-1, rows );
    JqgridResponse<Csvfilecontent> response = new JqgridResponse<Csvfilecontent>();
    if (search == true) {
        return getFilteredRecords(filters, pageRequest);

    Page<Csvfilecontent> contentPage =  searchForm.isEmpty()? null :serv.findBySearchTermsForm(searchForm.get("entity"),pageRequest);
    List<Csvfilecontent> contentmapped =;
return response;}

Could you please help me to know where is my error.



Add a Comment