Hi.

At several projects I needed a struts based "browser back" mechanism or a "subcall" mechanism. In both cases you have to store the last request (with request parameter) an restores it.

Subcall means: From different contextes I navigate to the same site. To increse usability I will the user let go back to the context he comes from.

I have written a BaseBackAction which all actions must subclass. This base action saves the requestpath and pushed it on a stack. To go back you have to implement a back-path in the struts-config.xml like

<action path="/back" type="org.mwolff.struts.actions.BackAction"/>

The BackAction pops the path from the stack and forwards to it. The stack is limited to n entries, 10 default. If no back is possible, the BackAction forwards to the same
path, where it calls from.


Only actions that subclass from the BaseBackAction can use this automatic mechanism. So there is a second mechanism to register if you don't use this base action.

The whole documentation is on

http://www.manfred-wolff.de/struts/articles/HowTo-Back.html

There you can also download the two classes.

Improvments and suggestions are welcome.

Manfred




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to