struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MLENEV...@abusinessware.com
Subject [s2]Would like each action to go throught my parent class
Date Wed, 18 Apr 2007 08:10:44 GMT
Hi all,

I would like to do as in Struts 1 with DispathAction : create a parent 
Action, which each other action extends, and each request/action passes by 
this parent action, and I could so add there the generic validations (user 
logged, etc...)

How could I do ?

I tried this :

My parent Action : 
public class CRMAction extends ActionSupport implements 
ServletRequestAware {
        private static final long serialVersionUID = 7543537304330132164L;
        private Logger log = Logger.getLogger(CRMAction.class);
 
        private HttpServletRequest request;

        @Override
        public String execute() throws Exception {
                //do all tests (user logged, ...)
                //...
                return super.execute();
        }
}

My others Actions :
public class LoginAction extends CRMAction {
        private static final long serialVersionUID = 
-5438115193615924021L;
        private Logger log = Logger.getLogger(LoginAction.class);
 
        public String myMethod () {
                //do something
                return "myForward";
        }
}

But I never go in CRMAction.execute()...

Thanks,

Regards,

Michaƫl
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message