You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by hunkpapa <hu...@gmx.de> on 2001/03/15 10:27:06 UTC

How to use the LinkTag?

Hi,
I've a problem with the LinkTag.
I uesed it with the the "page" attribute and with the "forward"
attribute
and it worked.
But how can I use the "name" and the "property" attributes ?
Where can I find any examples for the LinkTag ?
Thx
hunkpapa


Re: How to use the LinkTag?

Posted by Jean-Noël Ribette <je...@improve.fr>.
Looking at the LingTag source code, the "name" and "property" attributes can be used to add query parameters to the
link.
"name" and "property" should give access to a map whose keys will be the parameter names and values the parameter
values.

Exemple:

if you have in a jsp:
<%
// this could be in the perform method of an action.
Hashtable hastable = new Hashtable();
hashtable.put("attribute1", "value1");
hahstable.put("attribute2", "value2");
session.putAttribute("parameters", hashtable);
%>
...
<html:link href="page.jsp" name="parameters" scope="session">
...

you should get something like <a href="page.jsp?attribute1=value1&attribute2=value2">


Jean-Noel

----- Original Message -----
From: hunkpapa <hu...@gmx.de>
To: <st...@jakarta.apache.org>
Sent: Thursday, March 15, 2001 9:27 AM
Subject: How to use the LinkTag?


> Hi,
> I've a problem with the LinkTag.
> I uesed it with the the "page" attribute and with the "forward"
> attribute
> and it worked.
> But how can I use the "name" and the "property" attributes ?
> Where can I find any examples for the LinkTag ?
> Thx
> hunkpapa
>
>