Hi Ashutosh,
Well I havnt worked so extensively on role based security in
tiles. I will try to go through your mail once again whenever I have a
time. You may get some help from this site
http://www.lifl.fr/~dumoulin/tiles/ . I will also send you one pdf which
explains advanced tiles.
sachin
mumbai, xoriant
-----Original Message-----
From: Ashutosh Satyam [mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 10:55 AM
To: Struts Users Mailing List
Subject: RE: tiles-definition - role association issue
I have not received any response on this mail yet.
Any pointers on this will be appreciated.
- Ashutosh
-----Original Message-----
From: Ashutosh Satyam
Sent: Friday, September 17, 2004 9:21 PM
To: [EMAIL PROTECTED]
Subject: tiles-definition - role association issue
As per the Tiles Definition file syntax
In the tiles definition we can specify the role
(Role to be checked when definition will be inserted in a page.)
Similarly, It is possible to associate a role with tiles: put attribute.
I'm intending to allow the definition to be used based on the role.
The second scenario works fine for me.
I have my Login page for the application as stated below.
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<tiles:insert page="/WEB-INF/mainLayout.jsp" flush="true">
<tiles:put name="title" value="Welcome Page"/>
<tiles:put name="mainMenu" value="/adminMenupanel.jsp" role="admin"/>
<tiles:put name="mainMenu" value="/mgrMenupanel.jsp" role="manager"/>
<tiles:put name="mainMenu" value="/usrMenupanel.jsp" role="usr"/>
<tiles:put name="mainHeader" value="/header.jsp"/>
<tiles:put name="mainBody" value="/body.jsp"/>
<tiles:put name="mainFooter" value="/footer.jsp"/>
</tiles:insert>
Depending upon the user's role, correct definition is inserted.
Now going on the same lines, when I have a definition with role specified,
it
doesn't seem to work. My tiles-definition is as follows.
<definition name="baseDef" path="/WEB-INF/mainLayout.jsp" >
<put name="title" value="Tomcat Server" />
<put name="header" value="/header.jsp"/>
<put name="menu" value="/menupanel.jsp"/>
<put name="tab" value=""/>
<put name="body" value=""/>
</definition>
<definition name="Add" extends="baseDef" role="admin">
<put name="tab" value="/WEB-INF/pages/tab.jsp"/>
<put name="body" value="/WEB-INF/pages/body.jsp"/>
</definition>
This definition (Add) gets applied for each of my role, though I was
presuming that
only for the user with 'admin' role this definition will be executed.
What am I missing? Is it not a correct approach?
Kindly give some solution to achieve it.
Regards,
Ashutosh
---------------------------------------------------------------------
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]