You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Renato Romano <r....@set-network.com> on 2003/05/19 14:24:46 UTC
Html:link - Please Help
I have a tabel of search results; each row should have a link to a page
that accepts several parameters. I think I should I use the "Map"
approach of the html:link tag, but I need to define a Map for each row
in the resultset!! Anyway in this case I shoul store those maps using
some naming conventions, say "map0" for parameters to apply to firs row
in the result, "map1" ... And so on. Is there a better approach ?
Thanks a lot.
Renato
____________________________________
Renato Romano
Sistemi e Telematica S.p.A.
Calata Grazie - Vial Al Molo Giano
16127 - GENOVA
e-mail: r.romano@set-network.com
Tel.: 010 2712603
_____________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Html:link - Please Help
Posted by Gemes Tibor <ti...@i-trade.hu>.
Renato Romano írta:
>I have a tabel of search results; each row should have a link to a page
>that accepts several parameters. I think I should I use the "Map"
>approach of the html:link tag, but I need to define a Map for each row
>in the resultset!! Anyway in this case I shoul store those maps using
>some naming conventions, say "map0" for parameters to apply to firs row
>in the result, "map1" ... And so on. Is there a better approach ?
>Thanks a lot.
>
>
You can use the same map instance for each link, just change the values
stored in them.
Hth,
Tib
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Html:link - Please Help
Posted by Mark Lowe <ma...@talk21.com>.
ActionServlet or scriptlet.
ArrayList arrayOfMaps = new ArrayList();
HashMap mioMap = new HashMap();
mioMap.put("ref","1");
mioMap.put("displayString","Result One");
mioMap.put)"foo","bar");
arrayOfMaps.add(mioMap);
mioMap.put("ref","2");
mioMap.put("displayString","Result Two");
mioMap.put("foo","bar");
arrayOfMaps.add(mioMap);
//megilo nella page context ma va bene per questo espemio
request.setAttibrute(arrayOfMaps.toArray());
// in your jsp jsp.
<logic:iterate id="foo" name="arrayOfMaps">
<html:link name="foo" page="/prossima.do">
<bean:write name="foo" property="displayString" />
</html:link><br />
</logic:iterate>
renders...
<a href="/myapp/prossima.do?ref=1&foo=bar"> Result One </html:link><br
/>
<a href="/myapp/prossima.do?ref=2&foo=bar"> Result Two </html:link><br
/>
Watch out you not passing display logic as parameters, better to pass
an id and get the presentation strings at the time (i.e. <html:link
name="foo" property="ref" page="/jdfsjfh.do">).
Mi scusa per la domanda ma avete bisogni di sviluppi java/jsp a azienda
vostra? Sono ancora in Italia ma se non trovo qual cosa subito devo
torno qua in questi giorni.
Grazie mark
Lunedì, 19 mag 2003, alle 13:24 Europe/London, Renato Romano ha scritto:
> I have a tabel of search results; each row should have a link to a page
> that accepts several parameters. I think I should I use the "Map"
> approach of the html:link tag, but I need to define a Map for each row
> in the resultset!! Anyway in this case I shoul store those maps using
> some naming conventions, say "map0" for parameters to apply to firs row
> in the result, "map1" ... And so on. Is there a better approach ?
> Thanks a lot.
> Renato
>
> ____________________________________
> Renato Romano
> Sistemi e Telematica S.p.A.
> Calata Grazie - Vial Al Molo Giano
> 16127 - GENOVA
>
> e-mail: r.romano@set-network.com
> Tel.: 010 2712603
> _____________________________________
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org