You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "Kruse, Matt" <MK...@aquent.com> on 2003/04/25 16:58:40 UTC
Multiple Parameters with html:link?
As I'm painting a screen, I have to create links to another action and pass
several parameters based on the current record that I am painting.
html:link only allows me to pass either a single parameter or a list object.
So, I'm stuck with building a map of name/value pairs in my JSP, then
passing that to html:link, which seems messy. I'd prefer something like:
<html:link action="...">
<parameter name="id" value="1">
<parameter name="client" value="2">
</html:link>
Is something like this possible with add-on taglibs? Or is there a better
way to do this with html:link ?
Matt Kruse
Re: Multiple Parameters with html:link?
Posted by Mike Deegan <mp...@shaw.ca>.
Matt
To use multiple params with <html:link> you need to pass Params as a MAP !!
See : http://jakarta.apache.org/struts/struts-html.html#link
Also check out this link http://husted.com/struts/resources/linkParam.htm
Also this works for me ....
<c:url value="userPg" var="url">
<c:param name="ID" value="${item['id']}"/>
<c:param name="Dispatch" value="Zoom"/>
</c:url>
<a href='<c:out value="${url}"/>'>[Zoom...]</a>
ending up with the following url / anchor displayed in the JSP
[Zoom...]
with the following properties
http://localhost/do/userPg?ID=22&Dispatch=Zoom
will open in the same window
HTH
Mike
----- Original Message -----
From: "Kruse, Matt" <MK...@aquent.com>
To: "Taglibs User (E-mail)" <ta...@jakarta.apache.org>
Sent: Friday, April 25, 2003 8:58 AM
Subject: Multiple Parameters with html:link?
> As I'm painting a screen, I have to create links to another action and
pass
> several parameters based on the current record that I am painting.
> html:link only allows me to pass either a single parameter or a list
object.
> So, I'm stuck with building a map of name/value pairs in my JSP, then
> passing that to html:link, which seems messy. I'd prefer something like:
>
> <html:link action="...">
> <parameter name="id" value="1">
> <parameter name="client" value="2">
> </html:link>
>
> Is something like this possible with add-on taglibs? Or is there a better
> way to do this with html:link ?
>
> Matt Kruse
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Multiple Parameters with html:link?
Posted by Dave Newton <da...@solaraccess.com>.
On Fri, 2003-04-25 at 10:58, Kruse, Matt wrote:
> <html:link action="...">
> <parameter name="id" value="1">
> <parameter name="client" value="2">
> </html:link>
> Is something like this possible with add-on taglibs? Or is there a better
> way to do this with html:link ?
I don't believe that's currently possible, but it would be a fairly
trivial custom tag with minor html:link tag hacks.
It would be nice to have this functionality; I've wanted it too, just
not badly enough to spend the hour or three to write it :)
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org