为什么在 struts 1.* forward 中使用“redirect=true"? [英] Why use 'redirect=true' in struts 1.* forward?

查看:36
本文介绍了为什么在 struts 1.* forward 中使用“redirect=true"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在执行未显示的操作期间创建的 ActionMessages 遇到了一些问题,我发现我的问题是由于我的转发具有 redirect=true 在 struts-config.xml 中.

I've been having some problems with ActionMessages created during execution of an action which didn't display, and I found out that my problems were due to my forwards having redirect=true in struts-config.xml.

由于默认行为是 redirect=false,我一直在考虑使用 redirect=true 有哪些好处,但我找不到任何答案.有谁知道什么时候以及为什么 redirect=true 应该在动作转发中使用?

Since the default behavior is redirect=false, I've been thinking about which benefits can one have using redirect=true and I couldn't find any answer. Does anyone know when and why redirect=true should be used in action forwards?

推荐答案

防止重复提交问题"

从不显示响应 POST 的页面

始终使用 GET 加载页面

使用 REDIRECT 从 POST 导航到 GET

关于此的更多信息此处这里

这篇关于为什么在 struts 1.* forward 中使用“redirect=true"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆