更新时间:2023-09-11 23:03:22
阅读 INPUT结果的工作原理,然后已经放弃了ModelDriven设计模式,除了问题之外,该模式不会给您的编程体验带来任何好处,因为它们很容易隐藏在拦截器堆栈的中间 a>,请注意:
After having read how the INPUT result works and having abandoned the ModelDriven design pattern that adds nothing to your programming experience except problems, that might easily hide themselves in the middle of the Interceptor Stack, note that:
redirect
是重定向到外部URL或非Action URL时使用的结果,而redirectAction
重定向到Action时应使用; redirect
is the result to use when redirecting to external URLs or non-Action URLs, while redirectAction
should be used when redirecting to an Action;为防止这种情况,如果您想继续使用PRG模式(并因此使用重定向),可以使用 MessageStore拦截器,它将跨重定向为您存储和检索消息;只需定义一个包含它的拦截器堆栈即可解决您的问题.
To prevent that, if you want to keep using the PRG pattern (and hence the redirection), you can use the MessageStore Interceptor that will store and retrieve the messages for you across the redirections; just define an interceptor stack that contains it, and it will solve your problem.
或者像文档中示例中的那样进行一次
Or do it once like in the example from the documentation.