struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: using logic:iterate to load html:link
Date Tue, 31 Dec 2002 16:02:28 GMT
You can do this with the Struts-EL library, which is part of the Struts distribution.  Using
this, your tag could look like this:

  <html-el:link forward='${menuOpt["forward"]}' target='${menuOpt["target"]}'/>

The Struts-EL library uses the JSTL expression language engine for evaluating attribute values.
 Struts-EL requires a Servlet 2.3-compliant container.

> -----Original Message-----
> From: Steven Dahlin [mailto:sdahlin@cableone.net]
> 
> for my menu options I would like to load a dynamic list of 
> menu options which will be read by the jsp file.  The java 
> code will load a vector with the menu options like this:
> 
> Vector        vecMenuOpts    = new Vector();
> Hashtable   htblMenuOpt     = new Hashtable();
> 
> htblMenuOpt.put( "forward", "forwardindicator" );
> htblMenuOpt.put( "target", "_top" );
> htblMenuOpt.put( "description", "labeltoshow" );
> 
> vecMenuOpts.add( htblMenuOpt );
> 
> ... add other menu options and then write it in a bean to the 
> session ...
> 
> The Jsp would look like this:
> 
> <logic:iterate id="menuOpt" name="vecMenuOpts">
>     <html:link  
>          ... here is where I need to load the forward and target >
>        <bean:write name=menuOpt" property="description"/>
>     </html:link>
> </logic:iterate>
> 
> I would like to do this without having to use scriptlets.  Is 
> there a way to do this?

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


Mime
View raw message