Rob wrote:


Rob Leland wrote:


Rob wrote:

I have a set of statements I would like executed every time
an action is executed. I would also like to only have to
code these set of statements once and have them transparently
executed for all actions (except for a small subset).



When we were using a Servlet 2.2 container we derived a class
from Action named SecureAction, which checked that the user was logged in.


Can you explain how this was done in a little more detail, particularly
what methods were used, where they were used etc..? I have the current
arrangement where I extend Action with a BaseAction, which implements
my common method (the one to be called always) and then from subclasses
of BaseAction.execute() I call the common method.


Find out what method in Action calls the execute() method, which is empty.
I forget. Override that method in BaseAction, then place a call to your
common method in that method. That way no Action can be called unless
your common method says it can.

-Rob



It is this having to manually call the common method I would like to
eliminate and just have it transparently occur higher in the
hierarchy.

As for your suggestion of using filters could you direct me to more
information regarding that method I'm interested in exploring it.

Thanks

Then all the applications Actions would be SecureAction Children.

If struts had events then the event could be hooked instead, this is easy enough to do.


Under Servlet 2.3 filters could be used.


-Rob



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






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



Reply via email to