感谢Sotirios的评论所留下的提示,我发现无法“重定向”到“ myPage”与Tiles没有任何关系。
相反,经过一番努力,我意识到这是与“ myPage”关联的控制器的配置。
我必须将以下“ public ModelAndViewmyPage(HttpSession会话)”方法添加到Controller中(请参见下面的代码段),以便执行成功的重定向(即从另一个控制器进行重定向)…即,使用
return new ModelAndView("redirect:/myPage");问题是“ myPage”控制器 不 包含“公共ModelAndView
myPage(HttpSession会话)”方法…(再次感谢,Sotirius)。
下面是“公共ModelAndView myPage(HttpSession会话)”方法-代码段)
@Controller @Scope("session") @SessionAttributes( { "sharedList" }) public class MyPageController implements Serializable { @ModelAttribute("sharedList") public List<Pojo1> createSharedList() { return new ArrayList<Pojo1>(); } @RequestMapping(value = "/myPage", method = RequestMethod.GET) @ResponseBody public ModelAndView myPage(HttpSession session) { createSharedList(); return new ModelAndView("myPage"); } - - -


