开发者

How can I find the name of last action in Struts 2

开发者 https://www.devze.com 2022-12-18 19:17 出处:网络
In my proje开发者_如何学运维ct I am using Struts 2 with Freemarker. How can I find last action\'s name from inside the template?

In my proje开发者_如何学运维ct I am using Struts 2 with Freemarker. How can I find last action's name from inside the template?

For example:

* I have one FTL file for adding and editing the object,

* I would like to be able to find last actions name eg. ${actionContext.actionName}.

Is there a way to do that?


I have manually rendered a lastAction hidden form field set to the current action's name. It is the current action during rendering, but will become the last (or previous) action on the next request when the form POSTs or GETs.

It's been useful for me to revert back to the last action when the current user action (which could be triggered from one of several previous actions) fails for some reason.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号