私はそれが仕事をすると思います。検索パターンをセッションを通じて編集アクションに渡します。更新された検索結果を表示するには、検索ページにリダイレクトしてください。
@Controller
public class ProjectsController {
@RequestMapping(value = "edit", method = RequestMethod.POST)
String doEditProject(HttpSession httpSession, @ModelAttribute Project p) {
// persist the edited project
// redirect to search page with last search word
String searchPattern = (String) httpSession.getAttribute("search_pattern");
return "redirect:search?pattern=" + searchPattern;
}
@RequestMapping(value = "search", method = RequestMethod.GET)
String displaySearch(@RequestParam(value = "pattern", required = false) String searchPattern, ModelMap model, HttpSession httpSession) {
if (searchPattern == null) {
// display empty search view
return "searchView";
} else {
// search using the pattern
// put model and create links like edit?project_id=xx
httpSession.setAttribute("search_pattern", searchPattern);
return "searchView";
}
}
}
いくつかのチュートリアルを実行すると、今まで何を試してみましたか? – Shahzeb
あなたの問題の説明には、あなたのUIの仕組みに関する重要な情報が欠落しています。何をリフレッシュする必要がありますか?検索フォーム?検索結果は? –
あなたはアノテーションベースのスプリングmvcを使用していますか? –