<logic:iterate id="link" name="userView" property="menuList"> <html:link page="<%= link.getAction() %>"> <bean:write name="link" property="label" /> </html:link> </logic:iterate>

or

<c:forEach var="link" value="${userView.menuList}">
        <a href="<c:url value="${link.action}">
                <c:out value="${link.label}" />
        </a>
</c:forEach>

or

<c:forEach var="link" value="${userView.menuList}">
        <html-el:link page="${link.action}">
                <c:out value="${link.label}" />
        </html:link>
</c:forEach>

Cheers Mark

On 17 Jan 2004, at 02:34, Bryce Fischer wrote:

What I'm trying to do is create a list of items from an ArrayList in the
session.


My list is an Array list of objects. Here's the interface:

public interface SecurityMenuView {
        /**
         * Returns the Struts Action for the given Menu item
         *
         * @return
         */
        String getAction();
        
        /**
         * Returns the label for the given menu item.
         *
         * @return
         */
        String getLabel();
}

Now, this is what I'd like to do in my jsp (it obviously doesn't work..).

<logic:iterate id="link" name="userView.menuList">
        <li><html:link action="link.action"></li>
</logic:iterate>

So.. I'd like to set the action to the link element's "action" property.
Does anyone know a good way to do this? I've tried doing this too:


<logic:iterate id="link" name="userView" property="menuList">
        <li><a href='<bean:write name="link"
property="action"/>'><bean:write name="link" property="label"/></a>
</logic:iterate>

but it means hard coding the path to the action (i.e., "/my-app/action.do".

Thanks.

--
Bryce Fischer <[EMAIL PROTECTED]>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to