You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Antonis Lebesis <an...@gmail.com> on 2006/10/25 13:43:21 UTC

[SOLVED?]: Add request parameter in

After a lot of searching, I found that you there is no "struts way" of
adding a request parameter to <bean:include>. I used java code to
solve it:

<bean:include id="fooId" page='<%= "/loadFoo.do?fooParam=bar" %>'/>
<bean:write name="fooId"/>

Antonis.

On 10/25/06, Antonis Lebesis <an...@gmail.com> wrote:
> Hello Martin,
>   thanks for the answer, but I 'm afraid I wasn't clear. I want to set
> a parameter to the call of login action not retrieve it in the login
> action.
>
> Thanks again,
> Antonis
>
> On 10/25/06, Martin Gainty <mg...@hotmail.com> wrote:
> > The request parameter is available thru bean:parameter
> > be mindful that multiple="true" must be specified in the event you are sotring an array
> > For more info check out
> > http://struts.apache.org/1.x/struts-taglib/apidocs/org/apache/struts/taglib/bean/package-summary.html#package_description
> >
> > Anyone else?
> > M-
> >
> > This e-mail communication and any attachments may contain confidential and privileged information for the use of the
> > designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
> > this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
> > contents
> > ----- Original Message -----
> > From: "Antonis Lebesis" <an...@gmail.com>
> > To: "struts" <us...@struts.apache.org>
> > Sent: Tuesday, October 24, 2006 7:08 PM
> > Subject: Add request parameter in <bean:include>
> >
> >
> > > Hello,
> > >
> > >  I want to add a request parameter in <bean:include> tag. I searched
> > > the user guide, but I didn't find anything relevant. Have you any idea
> > > on how to do this?
> > >
> > > The code I 'm using is:
> > >
> > > <bean:include forward="login" id="loginForm"/>
> > > <bean:write name="loginForm" filter="false"/>
> > >
> > > Thanks,
> > > Antonis.
> > >
> > > ---------------------------------------------------------------------
> > > 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: [SOLVED?]: Add request parameter in

Posted by Jim Reynolds <ji...@gmail.com>.
In Struts 1.x I used to use this type of mechanism to add parameters
to an action. I think that is what you are trying to do, if not
dismiss.

In JSP collect data and put into a Map.
[
java.util.HashMap params = new java.util.HashMap();
params.put("imageNum", imageNum);
params.put("assetId", assetId);
params.put("loadNum", loadNum);
// put into context
pageContext.setAttribute("paramsLink", params);

]

then later on call action like so.
 action="EditImageException"  name="paramsLink"

If you look at the action docs, you will see it takes a name which is
a Map. This has saved me in past projects.

HTH






On 10/25/06, Antonis Lebesis <an...@gmail.com> wrote:
> After a lot of searching, I found that you there is no "struts way" of
> adding a request parameter to <bean:include>. I used java code to
> solve it:
>
> <bean:include id="fooId" page='<%= "/loadFoo.do?fooParam=bar" %>'/>
> <bean:write name="fooId"/>
>
> Antonis.
>
> On 10/25/06, Antonis Lebesis <an...@gmail.com> wrote:
> > Hello Martin,
> >   thanks for the answer, but I 'm afraid I wasn't clear. I want to set
> > a parameter to the call of login action not retrieve it in the login
> > action.
> >
> > Thanks again,
> > Antonis
> >
> > On 10/25/06, Martin Gainty <mg...@hotmail.com> wrote:
> > > The request parameter is available thru bean:parameter
> > > be mindful that multiple="true" must be specified in the event you are sotring an array
> > > For more info check out
> > > http://struts.apache.org/1.x/struts-taglib/apidocs/org/apache/struts/taglib/bean/package-summary.html#package_description
> > >
> > > Anyone else?
> > > M-
> > >
> > > This e-mail communication and any attachments may contain confidential and privileged information for the use of the
> > > designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
> > > this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
> > > contents
> > > ----- Original Message -----
> > > From: "Antonis Lebesis" <an...@gmail.com>
> > > To: "struts" <us...@struts.apache.org>
> > > Sent: Tuesday, October 24, 2006 7:08 PM
> > > Subject: Add request parameter in <bean:include>
> > >
> > >
> > > > Hello,
> > > >
> > > >  I want to add a request parameter in <bean:include> tag. I searched
> > > > the user guide, but I didn't find anything relevant. Have you any idea
> > > > on how to do this?
> > > >
> > > > The code I 'm using is:
> > > >
> > > > <bean:include forward="login" id="loginForm"/>
> > > > <bean:write name="loginForm" filter="false"/>
> > > >
> > > > Thanks,
> > > > Antonis.
> > > >
> > > > ---------------------------------------------------------------------
> > > > 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
>
>

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