struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russ Bonsall <rbons...@computer-guidance.com>
Subject RE: Extending Action and DispatchAction
Date Mon, 23 Sep 2002 20:20:46 GMT

Actually you can change your BaseAction to extend DispatchAction and it will
continue to work like Action.  When there is no dispatch method specified it
will try calling the execute method of the Action.  I am currently using
this approach and it works just fine.

Russ

-----Original Message-----
From: Darren Hill [mailto:dhill@724.com]
Sent: Monday, September 23, 2002 11:06 AM
To: 'Struts Users Mailing List'
Subject: RE: Extending Action and DispatchAction


Yeah .. guess that's my only option.

-----Original Message-----
From: Sri Sankaran [mailto:Sri.Sankaran@sas.com]
Sent: September 23, 2002 2:05 PM
To: Struts Users Mailing List
Subject: RE: Extending Action and DispatchAction


I think what he means is:

public class Foo extends Action {
  private void doCommonStuff() {
  }
}

public class Bar extends DispatchAction {
  private void doCommonStuff() {
  }
}

I think this calls for delegation to a class that just does the common
stuff.

public class Foo extends Action {
  private void doCommonStuff() {
    Baz.doCommonStuff();
  }
}

public class Bar extends DispatchAction {
  private void doCommonStuff() {
    Baz.doCommonStuff();
  }
}

Maybe not necessarily static, but that would be predicated by your needs.
Sri 

-----Original Message-----
From: Galbreath, Mark [mailto:Galbreath@tessco.com] 
Sent: Monday, September 23, 2002 1:58 PM
To: 'Struts Users Mailing List'
Subject: RE: Extending Action and DispatchAction


How are you extending 2 classes at the same time in the same Action class?
Can you describe your class hierarchy a little more clearly?

Mark

-----Original Message-----
From: Darren Hill [mailto:dhill@724.com]
Sent: Monday, September 23, 2002 1:52 PM

If I've got common code that happens in ALL actions and I extend BOTH Action
and DispatchAction .. how can I include the common methods for both actions,
rather the copying that code in each?

Darren

--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message