Indraj
Indraj

Reputation: 1

How to return list reults to current jsp in spring MVC by controller

@RequestMapping(value="/doSearch", method = RequestMethod.POST)
public ModelAndView listSerchClients(@RequestParam("bnCustomerName") String searchText) {
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("sclients",  prepareListofBean(clientService.listSearchClientss(searchText))) ;            
    return new ModelAndView("serchResult", model);
}

Curently Searchresults return to serchResult.jsp but i want to keep serch result in current jsp (search.jsp) how to achieve this

view Search.jsp

Upvotes: 0

Views: 933

Answers (1)

Jordi Castilla
Jordi Castilla

Reputation: 26961

Curently Searchresults return to serchResult.jsp but i want to keep serch result in current jsp (search.jsp) how to achieve this

This is because you return serchResult.jsp in the method. Just change the returning ModelAndView to search

return new ModelAndView("search", model);

Upvotes: 1

Related Questions