Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在对页面的获取请求中,我阅读了一些会话参数。如果缺少某些会话参数,我想重定向到主页或任何页面。
我尝试这样做,但显然响应已经在 doBeforeRender 调用之前提交。
我应该在哪里进行重定向?
已编辑:一种方法可能是通过 freemarker 模板中的 javascript 来实现。
它应该在doAction方法中。
doAction
我response.forward(path);在我的项目中使用它并且它有效。该路径是相对于站点根目录的。
response.forward(path);
希望能帮助到你。