You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bhaarat Sharma <bh...@gmail.com> on 2009/06/22 07:07:44 UTC
redirect action in s:submit
I have a button value like this
<s:submit value="Cancel" name="redirect-action:PHAInformation"/>
but I want to add some parameters along with this...is that possible to do
in the code above or do I have to make additions to struts.xml for this?
Re: redirect action in s:submit
Posted by Greg Lindholm <gr...@gmail.com>.
@Wes, I looked at both the 2.1.6 (that I'm using) and online svn followed
the 2.0.6 tag.
On Mon, Jun 22, 2009 at 11:13 AM, Wes Wannemacher <we...@wantii.com> wrote:
> Which version of the source were you looking through? I recently did
> some work with DefaultActionMapper, and this might be something that
> has been fixed since 2.0.6.
>
> -Wes
>
> On Mon, Jun 22, 2009 at 11:04 AM, Greg Lindholm<gr...@gmail.com>
> wrote:
> > From looking at the source it doesn't look like it should be adding the
> > .action extension so I would suggest you run it in the debugger and break
> in
> > DefaultActionMapper and see where the .action is coming from.
> >
> > On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma <bhaarat.s@gmail.com
> >wrote:
> >
> >> my Struts version is 2.0.6
> >> @Greg...I tried what you suggested..it works but not quite.
> >>
> >> "redirect:MyAction.action?param1=value1¶m2=value2"
> >>
> >> turns into the following url
> >> MyAction.action?PageSize=50&pageIndex=3.action
> >>
> >> problem is that it adds '.action' to the end...
>
Re: redirect action in s:submit
Posted by Wes Wannemacher <we...@wantii.com>.
Which version of the source were you looking through? I recently did
some work with DefaultActionMapper, and this might be something that
has been fixed since 2.0.6.
-Wes
On Mon, Jun 22, 2009 at 11:04 AM, Greg Lindholm<gr...@gmail.com> wrote:
> From looking at the source it doesn't look like it should be adding the
> .action extension so I would suggest you run it in the debugger and break in
> DefaultActionMapper and see where the .action is coming from.
>
> On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma <bh...@gmail.com>wrote:
>
>> my Struts version is 2.0.6
>> @Greg...I tried what you suggested..it works but not quite.
>>
>> "redirect:MyAction.action?param1=value1¶m2=value2"
>>
>> turns into the following url
>> MyAction.action?PageSize=50&pageIndex=3.action
>>
>> problem is that it adds '.action' to the end...
>>
>> On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty <mg...@hotmail.com>
>> wrote:
>>
>>
>> > > Yes it works and it's part of the DefaultActionMapper. I don't think
>> you
>> > > will be able to add parameters using the "redirect-action:" prefix. I
>> > > haven't try it but you should be able to use the "redirect:" prefix and
>> > > construct the url with parameters like this
>> > > "redirect:MyAction.action?param1=value1¶m2=value2".
>> >
>
--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: redirect action in s:submit
Posted by "Kofford, C Todd" <tk...@ku.edu>.
Couldn't you do something like the following?
<s:url id="myAction" action="MyAction" >
<s:param name="param1" value="value1" />
<s:param name="param2" value="value2" />
<s:param name="param3" value="value3" />
</s:url>
... redirect:%{myAction}
I haven't personally tried this, but I've used plenty of "action" URLs
with multiple parameters defined this way.
Todd Kofford
tkofford@ku.edu
University of Kansas - IT
-----Original Message-----
From: Greg Lindholm [mailto:greg.lindholm@gmail.com]
Sent: Monday, June 22, 2009 10:04 AM
To: Struts Users Mailing List
Subject: Re: redirect action in s:submit
>From looking at the source it doesn't look like it should be adding the
.action extension so I would suggest you run it in the debugger and
break in
DefaultActionMapper and see where the .action is coming from.
On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma
<bh...@gmail.com>wrote:
> my Struts version is 2.0.6
> @Greg...I tried what you suggested..it works but not quite.
>
> "redirect:MyAction.action?param1=value1¶m2=value2"
>
> turns into the following url
> MyAction.action?PageSize=50&pageIndex=3.action
>
> problem is that it adds '.action' to the end...
>
> On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty <mg...@hotmail.com>
> wrote:
>
>
> > > Yes it works and it's part of the DefaultActionMapper. I don't
think
> you
> > > will be able to add parameters using the "redirect-action:"
prefix. I
> > > haven't try it but you should be able to use the "redirect:"
prefix and
> > > construct the url with parameters like this
> > > "redirect:MyAction.action?param1=value1¶m2=value2".
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: redirect action in s:submit
Posted by Greg Lindholm <gr...@gmail.com>.
I just tested this (with 2.1.6) and it worked fine, no extra .action was
appended.
@Sam, Maybe you should:
1) double check which version of struts you are using
2) post the full <s:submit> tag
3) do a view source and post the <input> tag that gets generated
> What debugger can you suggest?
Not sure how to answer this question in a manner that would be helpful.
If you have never debugged a Struts 2 application then it's not like likely
anything I say can help you.
Better answer the 3 questions above and see if that reveals anything useful.
On Mon, Jun 22, 2009 at 11:21 AM, Sam Wun <sw...@gmail.com> wrote:
> What debugger can you suggest?
> I also wantn to debug struts in portal, but when there is problem in a
> protlet, if there is no error msg in the protal log file, I can't see
> anything wrong in the portal page, because the portal simply refresh
> the portal page and show the first page.
>
> On Tue, Jun 23, 2009 at 1:04 AM, Greg Lindholm<gr...@gmail.com>
> wrote:
> > From looking at the source it doesn't look like it should be adding the
> > .action extension so I would suggest you run it in the debugger and break
> in
> > DefaultActionMapper and see where the .action is coming from.
> >
> > On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma <bhaarat.s@gmail.com
> >wrote:
> >
> >> my Struts version is 2.0.6
> >> @Greg...I tried what you suggested..it works but not quite.
> >>
> >> "redirect:MyAction.action?param1=value1¶m2=value2"
> >>
> >> turns into the following url
> >> MyAction.action?PageSize=50&pageIndex=3.action
> >>
> >> problem is that it adds '.action' to the end...
> >>
> >> On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty <mg...@hotmail.com>
> >> wrote:
> >>
> >>
> >> > > Yes it works and it's part of the DefaultActionMapper. I don't
> think
> >> you
> >> > > will be able to add parameters using the "redirect-action:" prefix.
> I
> >> > > haven't try it but you should be able to use the "redirect:" prefix
> and
> >> > > construct the url with parameters like this
> >> > > "redirect:MyAction.action?param1=value1¶m2=value2".
> >> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: redirect action in s:submit
Posted by Sam Wun <sw...@gmail.com>.
What debugger can you suggest?
I also wantn to debug struts in portal, but when there is problem in a
protlet, if there is no error msg in the protal log file, I can't see
anything wrong in the portal page, because the portal simply refresh
the portal page and show the first page.
On Tue, Jun 23, 2009 at 1:04 AM, Greg Lindholm<gr...@gmail.com> wrote:
> From looking at the source it doesn't look like it should be adding the
> .action extension so I would suggest you run it in the debugger and break in
> DefaultActionMapper and see where the .action is coming from.
>
> On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma <bh...@gmail.com>wrote:
>
>> my Struts version is 2.0.6
>> @Greg...I tried what you suggested..it works but not quite.
>>
>> "redirect:MyAction.action?param1=value1¶m2=value2"
>>
>> turns into the following url
>> MyAction.action?PageSize=50&pageIndex=3.action
>>
>> problem is that it adds '.action' to the end...
>>
>> On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty <mg...@hotmail.com>
>> wrote:
>>
>>
>> > > Yes it works and it's part of the DefaultActionMapper. I don't think
>> you
>> > > will be able to add parameters using the "redirect-action:" prefix. I
>> > > haven't try it but you should be able to use the "redirect:" prefix and
>> > > construct the url with parameters like this
>> > > "redirect:MyAction.action?param1=value1¶m2=value2".
>> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: redirect action in s:submit
Posted by Greg Lindholm <gr...@gmail.com>.
>From looking at the source it doesn't look like it should be adding the
.action extension so I would suggest you run it in the debugger and break in
DefaultActionMapper and see where the .action is coming from.
On Mon, Jun 22, 2009 at 10:44 AM, Bhaarat Sharma <bh...@gmail.com>wrote:
> my Struts version is 2.0.6
> @Greg...I tried what you suggested..it works but not quite.
>
> "redirect:MyAction.action?param1=value1¶m2=value2"
>
> turns into the following url
> MyAction.action?PageSize=50&pageIndex=3.action
>
> problem is that it adds '.action' to the end...
>
> On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty <mg...@hotmail.com>
> wrote:
>
>
> > > Yes it works and it's part of the DefaultActionMapper. I don't think
> you
> > > will be able to add parameters using the "redirect-action:" prefix. I
> > > haven't try it but you should be able to use the "redirect:" prefix and
> > > construct the url with parameters like this
> > > "redirect:MyAction.action?param1=value1¶m2=value2".
> >
Re: redirect action in s:submit
Posted by Bhaarat Sharma <bh...@gmail.com>.
my Struts version is 2.0.6
@Greg...I tried what you suggested..it works but not quite.
"redirect:MyAction.action?param1=value1¶m2=value2"
turns into the following url
MyAction.action?PageSize=50&pageIndex=3.action
problem is that it adds '.action' to the end...
On Mon, Jun 22, 2009 at 10:04 AM, Martin Gainty <mg...@hotmail.com> wrote:
>
> attempt to decipher which version of struts the Op is using?
>
> thx,
> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
> > Date: Mon, 22 Jun 2009 09:42:58 -0400
> > Subject: Re: redirect action in s:submit
> > From: greg.lindholm@gmail.com
> > To: user@struts.apache.org
> >
> > On Mon, Jun 22, 2009 at 1:19 AM, dusty <du...@yahoo.com> wrote:
> >
> > >
> > > That works? What processes that redirect-action:PHAInformation
> parameter?
> > > Struts sees that and just redirects? If I knew how that worked then I
> > > could
> > > figure out how to add parameters.
> > >
> > >
> > Yes it works and it's part of the DefaultActionMapper. I don't think you
> > will be able to add parameters using the "redirect-action:" prefix. I
> > haven't try it but you should be able to use the "redirect:" prefix and
> > construct the url with parameters like this
> > "redirect:MyAction.action?param1=value1¶m2=value2".
>
> _________________________________________________________________
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
>
> http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
>
RE: redirect action in s:submit
Posted by Martin Gainty <mg...@hotmail.com>.
attempt to decipher which version of struts the Op is using?
thx,
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Mon, 22 Jun 2009 09:42:58 -0400
> Subject: Re: redirect action in s:submit
> From: greg.lindholm@gmail.com
> To: user@struts.apache.org
>
> On Mon, Jun 22, 2009 at 1:19 AM, dusty <du...@yahoo.com> wrote:
>
> >
> > That works? What processes that redirect-action:PHAInformation parameter?
> > Struts sees that and just redirects? If I knew how that worked then I
> > could
> > figure out how to add parameters.
> >
> >
> Yes it works and it's part of the DefaultActionMapper. I don't think you
> will be able to add parameters using the "redirect-action:" prefix. I
> haven't try it but you should be able to use the "redirect:" prefix and
> construct the url with parameters like this
> "redirect:MyAction.action?param1=value1¶m2=value2".
_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
Re: redirect action in s:submit
Posted by Greg Lindholm <gr...@gmail.com>.
On Mon, Jun 22, 2009 at 1:19 AM, dusty <du...@yahoo.com> wrote:
>
> That works? What processes that redirect-action:PHAInformation parameter?
> Struts sees that and just redirects? If I knew how that worked then I
> could
> figure out how to add parameters.
>
>
Yes it works and it's part of the DefaultActionMapper. I don't think you
will be able to add parameters using the "redirect-action:" prefix. I
haven't try it but you should be able to use the "redirect:" prefix and
construct the url with parameters like this
"redirect:MyAction.action?param1=value1¶m2=value2".
Re: redirect action in s:submit
Posted by dusty <du...@yahoo.com>.
That works? What processes that redirect-action:PHAInformation parameter?
Struts sees that and just redirects? If I knew how that worked then I could
figure out how to add parameters.
omnipresent wrote:
>
> I have a button value like this
> <s:submit value="Cancel" name="redirect-action:PHAInformation"/>
>
>
> but I want to add some parameters along with this...is that possible to do
> in the code above or do I have to make additions to struts.xml for this?
>
>
--
View this message in context: http://www.nabble.com/redirect-action-in-s%3Asubmit-tp24141831p24141895.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org