If I have a common static method in a class named Language.CheckLanguage(), and I want all action class execute() method will call CheckLanguage() like this
public String execute(){
Language.CheckLanguage();
// DO Business logic...
Return Action.SUCCESS;
}
Or any other convenient way?
Do it in a base Action, and extend it from any Action.
Then call
super()as first row of everyexecute().But, if you want it to be executed for every method, not only
execute(), then you should write an Interceptor.