开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜