gpt4 book ai didi

java - spring MVC中 Controller 如何将列表结果返回到当前jsp

转载 作者:行者123 更新时间:2023-12-01 10:52:25 27 4
gpt4 key购买 nike

@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);
}

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

view Search.jsp

最佳答案

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

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

return new ModelAndView("search", model);

关于java - spring MVC中 Controller 如何将列表结果返回到当前jsp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33777213/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com