You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by BH...@powersystems.rockwell.com on 2005/07/07 15:47:19 UTC

Struts Tiles Question

All,

I am using Struts Tiles to layout my site.  I have a vboxmenu design which
contains 4 menu levels:

<definition name="doc.menu.main" path="/common/jsp/layout/vboxLayout.jsp" >
  <putList name="list" >
    <add value="common.menu.home" />
    <add value="common.menu.authenticated"/>
    <add value="common.menu.admin" />
    <add value="common.menu.logout" />
  </putList>
</definition>

I am wanting to control when the Authenticated menu and the Admin Menu are
displayed.  For example, only display the admin menu if the user is in the
Admin Role.  I know that the taglib tld has a role attribute, but the dtd
for tiles-def does not.  Has anyone created anything simular with tiles?

Re: Struts Tiles Question

Posted by Laurie Harper <la...@holoweb.net>.
BHansard@powersystems.rockwell.com wrote:
> I am using Struts Tiles to layout my site.  I have a vboxmenu design which
> contains 4 menu levels:
> 
> <definition name="doc.menu.main" path="/common/jsp/layout/vboxLayout.jsp" >
>   <putList name="list" >
>     <add value="common.menu.home" />
>     <add value="common.menu.authenticated"/>
>     <add value="common.menu.admin" />
>     <add value="common.menu.logout" />
>   </putList>
> </definition>
> 
> I am wanting to control when the Authenticated menu and the Admin Menu are
> displayed.  For example, only display the admin menu if the user is in the
> Admin Role.  I know that the taglib tld has a role attribute, but the dtd
> for tiles-def does not.  Has anyone created anything simular with tiles?

As far as I'm aware, there's no way to do that at the tiles level. You 
could either wrap the <add/> tags in your JSP with <logic:present role=... 
or similar, or make the test in the JSP for the individual tiles, which may 
be cleaner.

L.
-- 
Laurie, Open Source advocate, Java geek and novice blogger:
http://www.holoweb.net/~laurie/


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