You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Giampiero De Ciantis <gd...@aci.on.ca> on 2003/06/17 19:43:38 UTC
embedding multiple parameters and associated values in a
I am trying to use an <html:link> item to submit some data, but I need to
send the value of 2 parameters. How do I assign multiple parameters within
an <html:link> tag?
Thanks
-Gp
Re: embedding multiple parameters and associated values in a
Posted by Kris Schneider <kr...@dotech.com>.
Personally, I think a custom tag would be overkill for something JSTL
can handle pretty easily (assuming you're running in a JSP 1.2 container):
<jsp:useBean id="editParams" class="java.util.HashMap"/>
<c:set target="${editParams}"
property="action"
value="prepareEditForm"/>
<c:set target="${editParams}"
property="accountId"
value="${account.accountId}"/>
<html:link action="/editAccountForm" name="editParams">
<c:out value="${account.systemName}"/>
</html:link>
From a pure MVC perspective, I suppose you could argue that even that's
an abuse of the view layer...
Sandeep Takhar wrote:
> Not a bad idea to create a custom tag to do this for
> you either.
>
> sandeep
> --- Carl Walker <wa...@georgetown.edu> wrote:
>
>>Here's an example where I make a URL with two
>>parameters, 'action' and
>>'accountId'.
>>
>>'account' is a pageContext-scoped variable put on
>>the page by the
>>logic:iterate tag.
>>
>> <%
>> HashMap editParams = new HashMap();
>> editParams.put("action",
>>"prepareEditForm");
>> editParams.put("accountId",
>>String.valueOf(((Account)account).getAccountId()));
>> pageContext.setAttribute("editParams",
>>editParams);
>> %>
>>
>> <html:link action="/editAccountForm.do"
>>name="editParams">
>> <bean:write name="account"
>>property="systemName" />
>> </html:link>
>>
>>
>>Giampiero De Ciantis wrote:
>>
>>
>>>I am trying to use an <html:link> item to submit
>>
>>some data, but I need to
>>
>>>send the value of 2 parameters. How do I assign
>>
>>multiple parameters within
>>
>>>an <html:link> tag?
>>>
>>>
>>>
>>>Thanks
>>>
>>>
>>>
>>>-Gp
--
Kris Schneider <ma...@dotech.com>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: embedding multiple parameters and associated values in a
Posted by Sandeep Takhar <sa...@yahoo.com>.
Not a bad idea to create a custom tag to do this for
you either.
sandeep
--- Carl Walker <wa...@georgetown.edu> wrote:
> Here's an example where I make a URL with two
> parameters, 'action' and
> 'accountId'.
>
> 'account' is a pageContext-scoped variable put on
> the page by the
> logic:iterate tag.
>
> <%
> HashMap editParams = new HashMap();
> editParams.put("action",
> "prepareEditForm");
> editParams.put("accountId",
> String.valueOf(((Account)account).getAccountId()));
> pageContext.setAttribute("editParams",
> editParams);
> %>
>
> <html:link action="/editAccountForm.do"
> name="editParams">
> <bean:write name="account"
> property="systemName" />
> </html:link>
>
>
> Giampiero De Ciantis wrote:
>
> > I am trying to use an <html:link> item to submit
> some data, but I need to
> > send the value of 2 parameters. How do I assign
> multiple parameters within
> > an <html:link> tag?
> >
> >
> >
> > Thanks
> >
> >
> >
> > -Gp
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: embedding multiple parameters and associated values in a
Posted by Carl Walker <wa...@georgetown.edu>.
Here's an example where I make a URL with two parameters, 'action' and
'accountId'.
'account' is a pageContext-scoped variable put on the page by the
logic:iterate tag.
<%
HashMap editParams = new HashMap();
editParams.put("action", "prepareEditForm");
editParams.put("accountId",
String.valueOf(((Account)account).getAccountId()));
pageContext.setAttribute("editParams", editParams);
%>
<html:link action="/editAccountForm.do" name="editParams">
<bean:write name="account" property="systemName" />
</html:link>
Giampiero De Ciantis wrote:
> I am trying to use an <html:link> item to submit some data, but I need to
> send the value of 2 parameters. How do I assign multiple parameters within
> an <html:link> tag?
>
>
>
> Thanks
>
>
>
> -Gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: embedding multiple parameters and associated values in a
Posted by Mike Jasnowski <mj...@bea.com>.
You can also of course just code them using a JSP expression that represents
a string built from many parameters.
-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Tuesday, June 17, 2003 2:45 PM
To: Struts Users Mailing List
Subject: RE: embedding multiple parameters and associated values in a
<html:link>
I think you can specify a map of parameters from a JavaBean that contains
them (look at the property att). Incidentally the JSTL <url> tag also has a
mechanism for passing multiple params via child tags.
-----Original Message-----
From: Giampiero De Ciantis [mailto:gdeciant@aci.on.ca]
Sent: Tuesday, June 17, 2003 1:44 PM
To: Struts User Mailing List
Subject: embedding multiple parameters and associated values in a
<html:link>
I am trying to use an <html:link> item to submit some data, but I need to
send the value of 2 parameters. How do I assign multiple parameters within
an <html:link> tag?
Thanks
-Gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: embedding multiple parameters and associated values in a
Posted by Mike Jasnowski <mj...@bea.com>.
I think you can specify a map of parameters from a JavaBean that contains
them (look at the property att). Incidentally the JSTL <url> tag also has a
mechanism for passing multiple params via child tags.
-----Original Message-----
From: Giampiero De Ciantis [mailto:gdeciant@aci.on.ca]
Sent: Tuesday, June 17, 2003 1:44 PM
To: Struts User Mailing List
Subject: embedding multiple parameters and associated values in a
<html:link>
I am trying to use an <html:link> item to submit some data, but I need to
send the value of 2 parameters. How do I assign multiple parameters within
an <html:link> tag?
Thanks
-Gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: embedding multiple parameters and associated values in a
Posted by David Bolsover <ju...@bolsover.com>.
take a look at the jstl <c:url> tag - it can accept multiple <c:param> tags.
db
-----Original Message-----
From: Giampiero De Ciantis [mailto:gdeciant@aci.on.ca]
Sent: 17 June 2003 18:44
To: Struts User Mailing List
Subject: embedding multiple parameters and associated values in a
<html:link>
I am trying to use an <html:link> item to submit some data, but I need to
send the value of 2 parameters. How do I assign multiple parameters within
an <html:link> tag?
Thanks
-Gp
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org