Struts2动作、输入和输出;消息存储拦截器逻辑

Struts2动作、输入和输出;消息存储拦截器逻辑,struts2,Struts2,我对重定向操作、输入结果和消息存储拦截器非常困惑 假设我们有两个操作,并且在它们的拦截器堆栈中都有消息存储 情景1 Form is submitted -> No Errors -> Returns success -> fires a redirectAction -> that action is executed -> fire SUCCESS -> final jsp displayed. 这是完美的,也是可以理解的 场景2 Form is subm

我对重定向操作、输入结果和消息存储拦截器非常困惑

假设我们有两个操作,并且在它们的拦截器堆栈中都有消息存储

情景1

Form is submitted -> No Errors -> Returns success -> fires a redirectAction -> that action is executed -> fire SUCCESS -> final jsp displayed.
这是完美的,也是可以理解的

场景2

Form is submitted -> There are errors -> Returns input -> fires a redirectAction -> due to message-store interceptor the errors/messages are found at the second action -> hence, the method shouldn't be executed, instead the errors will be found by an intermediate interceptor and it'll return INPUT
这个流程正确吗?我错过什么了吗

但是在第二个场景中,表单中填充了一些值,我看到第二个操作正在执行


请更正流程。

是,它将执行第二个操作,消息存储拦截器用于结转消息或字段错误。作为参考,我试图测试,但它没有执行第二个操作,以防第一个操作发送错误。由于某些中间拦截器在遇到错误时返回输入结果,所以我忘记了它的名称。