struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
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;

        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 = 
        private Logger log = Logger.getLogger(LoginAction.class);
        public String myMethod () {
                //do something
                return "myForward";

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



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message