Satish,
One way to achieve this is through inheritance and overriding. Every struts controller uses the execute() method to perform its duties. You can subclass struts Action, placing all common behavior in the execute() method and having all of your controllers subclass from this one class. The only thing about this is that each controller has its own mapping.findForward() declared in the execute() method - to make this flexible enough for all actions to use we must create an abstract method that will be used in all your controllers.... therefore, your code would have to have all controllers extend the one common class, and change the execute() method to call the abstract method.
It can look something like this:
The BaseAction class is the class all your controllers will extend:
Here is an example of one of your existing controller classes:
It will require your code to change, but once implemented you can place any common code for all controller actions in the BaseAction class without anything changing.
Things to note:
1. This will work on an Action level. Meaning that if the user should be logged in to perform the called action, it will
test it.
1. ALL your current controller classes will have to extend BaseAction instead of Action.
2. ALL your current controller classes will have to change the execute() method name to performExecute()
3. If there is a controller that does not require a person to be logged you must override the isLoginRequired() method.
Hope this helps. Let me know how it goes!
~DC