You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Agoston Bejo <be...@yahoo.com> on 2011/02/01 07:59:17 UTC


Hi!

I would like to specify the "action" attribute of an <s:submit/> such that it 
points to an action in a namespace other than which the jsp is in:

struts.xml:
 <package name="p" extends="root" namespace="/p">
...
  <action name="MyAction" class="package1.MyAction">
...
</package>


/p/p2/x.jsp:

<s:form action="...">
...
<s:url action="../MyAction"/> <%-- WORKS, but not an s:submit --%>

<%-- NEITHER OF THESE WORKS: --%>
<s:submit action="../MyAction"/>
<s:submit action="/p/MyAction"/>
<s:submit action="MyAction"/>


Any ideas?

Thanks,
Agoston


      

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


RE:

Posted by Martin Gainty <mg...@hotmail.com>.
you could make your form namespace aware by assigning the namespace attribute in the form tag
<s:form namespace="/p" />

Martin Gainty 
______________________________________________ 
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

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.




> From: vitordemario@gmail.com
> Date: Wed, 2 Feb 2011 10:17:31 -0200
> Subject: Re: <s:submit action="ACTION-IN-ANOTHER-NAMESPACE">
> To: user@struts.apache.org
> 
> I suppose you could submit via javascript, setting the entire url on the
> form.
> 
> document.forms[0].action = 'entireURLgoeshere';
> document.forms[0].submit();
> 
> That's not really a solution, just an ugly work-around.
> 
> On Tue, Feb 1, 2011 at 6:45 AM, Agoston Bejo <be...@yahoo.com> wrote:
> 
> >
> >
> > Thanks Chris,
> >
> >
> > the problem is that there are other s:submit buttons on the form the action
> > attributes of which point to actions in the current namespace. Changing the
> > namespace of the form would mess that up and I would end up with the same
> > problem.
> >
> > I've tried it out, and there's really no "namespace" attribute for the
> > s:submit
> > element, although obviously that would be the most sensible solution.
> >
> > Any other ideas how one could solve this?
> >
> >
> > Thanks,
> > Agoston
> >
> >
> > ----- Original Message ----
> > From: Chris Pratt <th...@gmail.com>
> > To: Struts Users Mailing List <us...@struts.apache.org>
> > Sent: Tue, February 1, 2011 8:55:32 AM
> > Subject: Re: <s:submit action="ACTION-IN-ANOTHER-NAMESPACE">
> >
> > It should have a namespace attribute, like all the other tags with action &
> > method attributes, but I don't see it in the documentation.  You might give
> > it a try, just in case it's just un-documented.
> >
> > <s:submit action="MyAction" namespace="/p"/>
> >
> > Otherwise, the more common way would be:
> >
> > <s:form action="MyAction" namespace="/p">
> >  <s:submit/>
> > </s:form>
> >
> >  (*Chris*)
> >
> > On Mon, Jan 31, 2011 at 10:59 PM, Agoston Bejo <be...@yahoo.com> wrote:
> >
> > >
> > >
> > > Hi!
> > >
> > > I would like to specify the "action" attribute of an <s:submit/> such
> > that
> > > it
> > > points to an action in a namespace other than which the jsp is in:
> > >
> > > struts.xml:
> > >  <package name="p" extends="root" namespace="/p">
> > > ...
> > >  <action name="MyAction" class="package1.MyAction">
> > > ...
> > > </package>
> > >
> > >
> > > /p/p2/x.jsp:
> > >
> > > <s:form action="...">
> > > ...
> > > <s:url action="../MyAction"/> <%-- WORKS, but not an s:submit --%>
> > >
> > > <%-- NEITHER OF THESE WORKS: --%>
> > > <s:submit action="../MyAction"/>
> > > <s:submit action="/p/MyAction"/>
> > > <s:submit action="MyAction"/>
> > >
> > >
> > > Any ideas?
> > >
> > > Thanks,
> > > Agoston
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
 		 	   		  

Re:

Posted by Vitor De Mario <vi...@gmail.com>.
I suppose you could submit via javascript, setting the entire url on the
form.

document.forms[0].action = 'entireURLgoeshere';
document.forms[0].submit();

That's not really a solution, just an ugly work-around.

On Tue, Feb 1, 2011 at 6:45 AM, Agoston Bejo <be...@yahoo.com> wrote:

>
>
> Thanks Chris,
>
>
> the problem is that there are other s:submit buttons on the form the action
> attributes of which point to actions in the current namespace. Changing the
> namespace of the form would mess that up and I would end up with the same
> problem.
>
> I've tried it out, and there's really no "namespace" attribute for the
> s:submit
> element, although obviously that would be the most sensible solution.
>
> Any other ideas how one could solve this?
>
>
> Thanks,
> Agoston
>
>
> ----- Original Message ----
> From: Chris Pratt <th...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Tue, February 1, 2011 8:55:32 AM
> Subject: Re: <s:submit action="ACTION-IN-ANOTHER-NAMESPACE">
>
> It should have a namespace attribute, like all the other tags with action &
> method attributes, but I don't see it in the documentation.  You might give
> it a try, just in case it's just un-documented.
>
> <s:submit action="MyAction" namespace="/p"/>
>
> Otherwise, the more common way would be:
>
> <s:form action="MyAction" namespace="/p">
>  <s:submit/>
> </s:form>
>
>  (*Chris*)
>
> On Mon, Jan 31, 2011 at 10:59 PM, Agoston Bejo <be...@yahoo.com> wrote:
>
> >
> >
> > Hi!
> >
> > I would like to specify the "action" attribute of an <s:submit/> such
> that
> > it
> > points to an action in a namespace other than which the jsp is in:
> >
> > struts.xml:
> >  <package name="p" extends="root" namespace="/p">
> > ...
> >  <action name="MyAction" class="package1.MyAction">
> > ...
> > </package>
> >
> >
> > /p/p2/x.jsp:
> >
> > <s:form action="...">
> > ...
> > <s:url action="../MyAction"/> <%-- WORKS, but not an s:submit --%>
> >
> > <%-- NEITHER OF THESE WORKS: --%>
> > <s:submit action="../MyAction"/>
> > <s:submit action="/p/MyAction"/>
> > <s:submit action="MyAction"/>
> >
> >
> > Any ideas?
> >
> > Thanks,
> > Agoston
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re:

Posted by Chris Pratt <th...@gmail.com>.
I suppose it wouldn't be possible to have the action sort it out using
separate methods?  You could use:

<s:submit action="MySuperAction" method="other"/>

  (*Chris*)

On Tue, Feb 1, 2011 at 12:45 AM, Agoston Bejo <be...@yahoo.com> wrote:

>
>
> Thanks Chris,
>
>
> the problem is that there are other s:submit buttons on the form the action
> attributes of which point to actions in the current namespace. Changing the
> namespace of the form would mess that up and I would end up with the same
> problem.
>
> I've tried it out, and there's really no "namespace" attribute for the
> s:submit
> element, although obviously that would be the most sensible solution.
>
> Any other ideas how one could solve this?
>
>
> Thanks,
> Agoston
>
>
> ----- Original Message ----
> From: Chris Pratt <th...@gmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Tue, February 1, 2011 8:55:32 AM
> Subject: Re: <s:submit action="ACTION-IN-ANOTHER-NAMESPACE">
>
> It should have a namespace attribute, like all the other tags with action &
> method attributes, but I don't see it in the documentation.  You might give
> it a try, just in case it's just un-documented.
>
> <s:submit action="MyAction" namespace="/p"/>
>
> Otherwise, the more common way would be:
>
> <s:form action="MyAction" namespace="/p">
>  <s:submit/>
> </s:form>
>
>  (*Chris*)
>
> On Mon, Jan 31, 2011 at 10:59 PM, Agoston Bejo <be...@yahoo.com> wrote:
>
> >
> >
> > Hi!
> >
> > I would like to specify the "action" attribute of an <s:submit/> such
> that
> > it
> > points to an action in a namespace other than which the jsp is in:
> >
> > struts.xml:
> >  <package name="p" extends="root" namespace="/p">
> > ...
> >  <action name="MyAction" class="package1.MyAction">
> > ...
> > </package>
> >
> >
> > /p/p2/x.jsp:
> >
> > <s:form action="...">
> > ...
> > <s:url action="../MyAction"/> <%-- WORKS, but not an s:submit --%>
> >
> > <%-- NEITHER OF THESE WORKS: --%>
> > <s:submit action="../MyAction"/>
> > <s:submit action="/p/MyAction"/>
> > <s:submit action="MyAction"/>
> >
> >
> > Any ideas?
> >
> > Thanks,
> > Agoston
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re:

Posted by Agoston Bejo <be...@yahoo.com>.

Thanks Chris,


the problem is that there are other s:submit buttons on the form the action 
attributes of which point to actions in the current namespace. Changing the 
namespace of the form would mess that up and I would end up with the same 
problem.

I've tried it out, and there's really no "namespace" attribute for the s:submit 
element, although obviously that would be the most sensible solution. 

Any other ideas how one could solve this?


Thanks,
Agoston


----- Original Message ----
From: Chris Pratt <th...@gmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Tue, February 1, 2011 8:55:32 AM
Subject: Re: <s:submit action="ACTION-IN-ANOTHER-NAMESPACE">

It should have a namespace attribute, like all the other tags with action &
method attributes, but I don't see it in the documentation.  You might give
it a try, just in case it's just un-documented.

<s:submit action="MyAction" namespace="/p"/>

Otherwise, the more common way would be:

<s:form action="MyAction" namespace="/p">
  <s:submit/>
</s:form>

  (*Chris*)

On Mon, Jan 31, 2011 at 10:59 PM, Agoston Bejo <be...@yahoo.com> wrote:

>
>
> Hi!
>
> I would like to specify the "action" attribute of an <s:submit/> such that
> it
> points to an action in a namespace other than which the jsp is in:
>
> struts.xml:
>  <package name="p" extends="root" namespace="/p">
> ...
>  <action name="MyAction" class="package1.MyAction">
> ...
> </package>
>
>
> /p/p2/x.jsp:
>
> <s:form action="...">
> ...
> <s:url action="../MyAction"/> <%-- WORKS, but not an s:submit --%>
>
> <%-- NEITHER OF THESE WORKS: --%>
> <s:submit action="../MyAction"/>
> <s:submit action="/p/MyAction"/>
> <s:submit action="MyAction"/>
>
>
> Any ideas?
>
> Thanks,
> Agoston
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



      

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


Re:

Posted by Chris Pratt <th...@gmail.com>.
It should have a namespace attribute, like all the other tags with action &
method attributes, but I don't see it in the documentation.  You might give
it a try, just in case it's just un-documented.

<s:submit action="MyAction" namespace="/p"/>

Otherwise, the more common way would be:

<s:form action="MyAction" namespace="/p">
  <s:submit/>
</s:form>

  (*Chris*)

On Mon, Jan 31, 2011 at 10:59 PM, Agoston Bejo <be...@yahoo.com> wrote:

>
>
> Hi!
>
> I would like to specify the "action" attribute of an <s:submit/> such that
> it
> points to an action in a namespace other than which the jsp is in:
>
> struts.xml:
>  <package name="p" extends="root" namespace="/p">
> ...
>  <action name="MyAction" class="package1.MyAction">
> ...
> </package>
>
>
> /p/p2/x.jsp:
>
> <s:form action="...">
> ...
> <s:url action="../MyAction"/> <%-- WORKS, but not an s:submit --%>
>
> <%-- NEITHER OF THESE WORKS: --%>
> <s:submit action="../MyAction"/>
> <s:submit action="/p/MyAction"/>
> <s:submit action="MyAction"/>
>
>
> Any ideas?
>
> Thanks,
> Agoston
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>