You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Slimane Zouggari <sl...@clin.ucl.ac.be> on 2002/03/08 09:05:15 UTC

[Newbie] html:link

Hi,

I have the following piece of code :

><logic:iterate id="elt" name="listform" scope="session" property="vect" 
>type="be.stluc.info.struts.ElementProjet">
><A HREF="/projectdetails.do?codpro="<bean:write name="elt" property="codpro"/>
>&codpha=<bean:write name="elt" property="codpha"/>
>&codtac=<bean:write name="elt" property="codtac"/>">
><bean:write name="elt" property="lib"/>
></A>
><BR>
></logic:iterate>

I was wondering if there's a easier way to do that with the html:link tag ?

Thanx in advance,
Slimane


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Newbie] html:link

Posted by Slimane <z...@skynet.be>.
Hi,

Nobody had answered me 'till you did. So, thank you and I will take a look 
at the java.util.Map :)

Friendly Regards,
Slimane

At 05:05 11/03/2002 +1100, you wrote:
>Hi Silmane,
>
>you may have already received a reply regarding this but none the less
>this is how I've been doing it.
>
>If you place a java.util.Map into the request the html:link tag will
>then build
>the parameter list for you where the keys are the parameter names and
>their
>values the parameter values (of course).
>
>In your case your iterating over a Collection of beans and from that
>collection
>you would/could provide a method to return the Map.
>
>In my example I have a Vector of 'foo.Bar' objects where Bar objects
>have a getter
>method for the map property.  My Vector of foo.Bar objects is an
>attribute of the
>request stored under the key 'things'.
>
><logic:iterate id="bar" name="things" type="foo.Bar">
>linkname The documentation for the link tag is of course located at: 
>http://jakarta.apache.org/struts/struts-html.html#link There are a couple 
>of restrictions I didn't mention documented there. Someone just helped me 
>out with this a few days ago so to whomever it was thanks. Rob Slimane 
>Zouggari wrote: > > Hi, > > I have the following piece of code 
>: > > > >type="be.stluc.info.struts.ElementProjet"> > > > >&codpha= > >&cod 
>tac="> > > > > > >
> > > > > I was wondering if there's a easier way to do that with the 
> html:link tag ? > > Thanx in advance, > Slimane > > -- > To unsubscribe, 
> e-mail: > For additional commands, e-mail: -- To unsubscribe, e-mail: For 
> additional commands, e-mail:


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [Newbie] html:link

Posted by tyler <ro...@fastmail.fm>.
Hi Silmane,

you may have already received a reply regarding this but none the less
this is how I've been doing it.

If you place a java.util.Map into the request the html:link tag will
then build
the parameter list for you where the keys are the parameter names and
their
values the parameter values (of course).

In your case your iterating over a Collection of beans and from that
collection
you would/could provide a method to return the Map.

In my example I have a Vector of 'foo.Bar' objects where Bar objects
have a getter
method for the map property.  My Vector of foo.Bar objects is an
attribute of the 
request stored under the key 'things'.

<logic:iterate id="bar" name="things" type="foo.Bar">
<html:link href="wherever" paramName="bar" name="bar" property="map">
linkname </html:link>
</logic:iterate>

The documentation for the link tag is of course located at:
http://jakarta.apache.org/struts/struts-html.html#link
There are a couple of restrictions I didn't mention documented there.

Someone just helped me out with this a few days ago so to whomever it
was thanks.

Rob

Slimane Zouggari wrote:
>
> Hi,
> 
> I have the following piece of code :
> 
> ><logic:iterate id="elt" name="listform" scope="session" property="vect"
> >type="be.stluc.info.struts.ElementProjet">
> ><A HREF="/projectdetails.do?codpro="<bean:write name="elt" property="codpro"/>
> >&codpha=<bean:write name="elt" property="codpha"/>
> >&codtac=<bean:write name="elt" property="codtac"/>">
> ><bean:write name="elt" property="lib"/>
> ></A>
> ><BR>
> ></logic:iterate>
> 
> I was wondering if there's a easier way to do that with the html:link tag ?
> 
> Thanx in advance,
> Slimane
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>