You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pierre Goupil <go...@gmail.com> on 2006/12/05 07:51:46 UTC

more than one parameter in a link

Hi, Strutsers !

For my first question here, I would like to know how to make an <html:link>
which would contain more than one parameter without having to use a bean
property.

For example, I would like to be able to generate such a link :

http://localhost/myApp/myAction.do?type=2&id=12

Of course, I could use a Map from my bean. But the problem is that, in my
case, the bean have no way to know which value to give to the JSP : it's the
JSP and it only who knows the values...

Regards,


Pierre



-- 
"L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire."

Re: more than one parameter in a link

Posted by Nuwan Chandrasoma <my...@gmail.com>.
use JSTL  c:url tag.

eg:

<c:url="myAction.do" var="myLink">
<c:param name="type" value="${user.value}"/>
<c:param name="id" value="${user.id}"/>
</c:url>

<a href='<c:out  vaue="${myLink}"/>'>My Link</a>

Thanks,

Nuwan
----- Original Message ----- 
From: "Pierre Goupil" <go...@gmail.com>
To: <us...@struts.apache.org>
Sent: Tuesday, December 05, 2006 6:51 AM
Subject: more than one parameter in a link


> Hi, Strutsers !
>
> For my first question here, I would like to know how to make an 
> <html:link>
> which would contain more than one parameter without having to use a bean
> property.
>
> For example, I would like to be able to generate such a link :
>
> http://localhost/myApp/myAction.do?type=2&id=12
>
> Of course, I could use a Map from my bean. But the problem is that, in my
> case, the bean have no way to know which value to give to the JSP : it's 
> the
> JSP and it only who knows the values...
>
> Regards,
>
>
> Pierre
>
>
>
> -- 
> "L'une des raisons pour lesquelles la vie est complexe
> C'est qu'elle a une partie réelle et une partie imaginaire."
> 


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


Re: more than one parameter in a link

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Pierre Goupil wrote:
> http://localhost/myApp/myAction.do?type=2&id=12
>
> Of course, I could use a Map from my bean. But the problem is that, in my
> case, the bean have no way to know which value to give to the JSP : 
> it's the
> JSP and it only who knows the values...
<jsp:useBean id="map" class="java.util.HashMap" />
<c:set target="${map}" property="key1" value="value1"/>
<c:set target="${map}" property="key2" value="value2"/>
<html:link action="/action" name="map">link</html:link>

-- 
Mikolaj Rydzewski <mi...@ceti.pl>