繁体   English   中英

如何通过控制器将列表返回结果返回到Spring MVC中的当前JSP

[英]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);
}

当前,Searchresults返回到serchResult.jsp但我想将serchResult.jsp结果保留在当前的jsp(search.jsp)中,如何实现此目的

查看Search.jsp

目前,Searchresults返回到serchResult.jsp但是我想将serch结果保留在当前的jsp( search.jsp )中,如何实现这一点。

这是因为您在方法中返回了serchResult.jsp 只需更改返回的ModelAndView进行search

return new ModelAndView("search", model);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM