You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by julio <ju...@softsite.com.br> on 2002/09/23 20:25:34 UTC
SwitchAction Parameters
Hi all,
I´m using the SwithAction, but I did´t want to put the parameters prefix
and page in the url.(for example
http://foo/bar.do?prefix""&page="foobar.jsp"). I would like to specify
the parameters in the struts-config.xml:
<action path="/switch"
type="org.apache.struts.action.SwitchAction"
page="foobar.jsp"
prefix="">
</action>
Is this possible or just an heresy? :)
Julio Cesar
-----Mensagem original-----
De: Darren Hill [mailto:dhill@724.com]
Enviada em: segunda-feira, 23 de setembro de 2002 15:06
Para: 'Struts Users Mailing List'
Assunto: 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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RES: SwitchAction Parameters
Posted by julio <ju...@softsite.com.br>.
Yeah, he just ignores it.
Julio Cesar
-----Mensagem original-----
De: Eddie Bush [mailto:ekbush@swbell.net]
Enviada em: segunda-feira, 23 de setembro de 2002 15:44
Para: Struts Users Mailing List
Assunto: Re: SwitchAction Parameters
It says they must be request parameters. You can put them there, and
the digester will ... gee, can't think right now - it will either
silently ignore them or you'll get a SAXException, I think. I believe
the latter is what you will find. Have you actually tried this yet?
They aren't properties on the class (that I'm aware of) -- they are
expected to be, just as is stated, request parameters (not to be
confused with request attributes!).
julio wrote:
>Hi all,
>
>I´m using the SwithAction, but I did´t want to put the parameters
prefix
>and page in the url.(for example
>http://foo/bar.do?prefix""&page="foobar.jsp"). I would like to specify
>the parameters in the struts-config.xml:
>
><action path="/switch"
> type="org.apache.struts.action.SwitchAction"
> page="foobar.jsp"
> prefix="">
></action>
>
>Is this possible or just an heresy? :)
>
>
>Julio Cesar
>
--
Eddie Bush
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: SwitchAction Parameters
Posted by Eddie Bush <ek...@swbell.net>.
It says they must be request parameters. You can put them there, and
the digester will ... gee, can't think right now - it will either
silently ignore them or you'll get a SAXException, I think. I believe
the latter is what you will find. Have you actually tried this yet?
They aren't properties on the class (that I'm aware of) -- they are
expected to be, just as is stated, request parameters (not to be
confused with request attributes!).
julio wrote:
>Hi all,
>
>I´m using the SwithAction, but I did´t want to put the parameters prefix
>and page in the url.(for example
>http://foo/bar.do?prefix""&page="foobar.jsp"). I would like to specify
>the parameters in the struts-config.xml:
>
><action path="/switch"
> type="org.apache.struts.action.SwitchAction"
> page="foobar.jsp"
> prefix="">
></action>
>
>Is this possible or just an heresy? :)
>
>
>Julio Cesar
>
--
Eddie Bush
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
AW: SwitchAction Parameters
Posted by "Ralf E. Stranzenbach" <mo...@reswi.de>.
Sorry,
it's the proper reply on the wrong message.
Ralf
-----Ursprüngliche Nachricht-----
Von: Ralf E. Stranzenbach [mailto:mobil@reswi.de]
Gesendet: Montag, 23. September 2002 22:17
An: Struts Users Mailing List
Betreff: AW: SwitchAction Parameters
Alles klar, ich werde mein Adressbuch aktualisieren.
Gruss,
Ralf
-----Ursprüngliche Nachricht-----
Von: julio [mailto:julio@softsite.com.br]
Gesendet: Montag, 23. September 2002 20:26
An: 'Struts Users Mailing List'
Betreff: SwitchAction Parameters
Hi all,
I´m using the SwithAction, but I did´t want to put the parameters prefix
and page in the url.(for example
http://foo/bar.do?prefix""&page="foobar.jsp"). I would like to specify
the parameters in the struts-config.xml:
<action path="/switch"
type="org.apache.struts.action.SwitchAction"
page="foobar.jsp"
prefix="">
</action>
Is this possible or just an heresy? :)
Julio Cesar
-----Mensagem original-----
De: Darren Hill [mailto:dhill@724.com]
Enviada em: segunda-feira, 23 de setembro de 2002 15:06
Para: 'Struts Users Mailing List'
Assunto: 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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
AW: SwitchAction Parameters
Posted by "Ralf E. Stranzenbach" <mo...@reswi.de>.
Alles klar, ich werde mein Adressbuch aktualisieren.
Gruss,
Ralf
-----Ursprüngliche Nachricht-----
Von: julio [mailto:julio@softsite.com.br]
Gesendet: Montag, 23. September 2002 20:26
An: 'Struts Users Mailing List'
Betreff: SwitchAction Parameters
Hi all,
I´m using the SwithAction, but I did´t want to put the parameters prefix
and page in the url.(for example
http://foo/bar.do?prefix""&page="foobar.jsp"). I would like to specify
the parameters in the struts-config.xml:
<action path="/switch"
type="org.apache.struts.action.SwitchAction"
page="foobar.jsp"
prefix="">
</action>
Is this possible or just an heresy? :)
Julio Cesar
-----Mensagem original-----
De: Darren Hill [mailto:dhill@724.com]
Enviada em: segunda-feira, 23 de setembro de 2002 15:06
Para: 'Struts Users Mailing List'
Assunto: 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:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>