struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Mitchell" <jmitch...@apache.org>
Subject Re: multiple params in <html:link...
Date Wed, 18 May 2005 22:45:34 GMT
No need for a scriptlet if you can use JSTL.

Do this:

<jsp:useBean id="linkParams" class="java.util.HashMap"/>
<c:set target="${linkParams}" property="id" value="${bean.userId}"/>
<c:set target="${linkParams}" property="view" value="summary"/>

...then use it in your link tag...

<html:link action="/foo" name="linkParams">Go to foo></html:link>


...renders like this...

<a href="/myapp/foo.do?id=45&view=summary">Go to foo</a>


--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   jmitchell@apache.org




----- Original Message ----- 
From: "Grzegorz Stasica" <gstasica@poczta.onet.pl>
To: <user@struts.apache.org>
Sent: Wednesday, May 18, 2005 4:47 PM
Subject: multiple params in <html:link...


> hi,
> 
> Is there a easy way to have more than one param attached to strut's 
> <html:link forward ..>
> I know that there is a soultion with HashMap, but in case I just need to 
>  attache additional param to already exsisting in some bean I'm bound 
> to use scriplet to create a hashmap.
> 
> Rgs
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message