Bear with a beginner's question, please. Loads of docs imply this is
possible, but I haven't found ones that actually illustrate how to do it.
Standard scenario, a user can be logged in or out. I want to determine which
Tile is included based on whether they're logged in. This can be determined
from a bean in the session scope.
I have it working, but there must be a better way. My version uses
struts-logic in a JSP to use the bean value to determine which Tile to
insert. But I want to do away with this JSP and make that decision in the
tiles-defs.xml file to reduce the coupling between the various components.
>From tiles-defs.xml
<definition name="tiledef.master" path="/layouts/master.jsp" >
<put name="title" value="xxxx.com - via struts/tiles" />
<put name="header" value="/tiles/header.jsp" />
<put name="footer" value="/tiles/footer.jsp" />
<put name="body" value="/tiles/body.jsp" />
<put name="menu" value="/tiles/menu.jsp" />
<put name="status" value="/tiles/loggedinout.jsp" />
</definition>
<definition name="tiledef.home" extends="tiledef.master">
<put name="title" value="xxxx.com - home page" />
<put name="body" value="/pages/home.jsp" />
</definition>
>From loggedinout.jsp (this is the file that I want do do away with):
<logic:equal name="loggedin" value="loggedin" scope="session"><tiles:insert
page="/tiles/loggedin.jsp"/></logic:equal>
<logic:notEqual name="loggedin" value="loggedin"
scope="session"><tiles:insert page="/tiles/loggedout.jsp"/></logic:notEqual>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]