You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Zhang, Larry (L.)" <lz...@ford.com> on 2008/07/14 19:28:48 UTC

Tiles questions

I have a mainLayout which has a header, body and footer.(and thus I have
4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice
that body.jsp will be different for each different screen page).

One setting can be of:

<!-- shared by all -->
<definition name="mainLayout" path="/jsp/common/mainLayout.jsp">
        <put name="header" value="/jsp/common/header.jsp" />
	  <put name="body" value="" />
        <put name="footer" value="/jsp/common/footer.jsp" />
</definition>

<!-- this is different from each screen page -->
<definition name="viewemployee" extends="mainLayout">
   <put name="body" value="/jsp/employee/employee.jsp" />
</definition>  	
    

Then I have a further requirement: Manager pages's body has left, middle
and right. All manager pages will have common left and right, but middle
will be different. So I define the managerBody like

	<!-- every manager page shares this -->
	 <definition name="managerBody"
path="/jsp/common/managerBodyLayout.jsp">
		<put name="left" value="/jsp/common/left.jsp"/>
		<put name="middle" value=""/>
		<put name="right" value="/jsp/common/right.jsp"/>
	</definition>

Then if I have managerPage1, I can define as:

 <definition name="managerPage1" extends="mainLayout">
      	<put name="bodyContent" value="managerBody"/>
		<put name="middle"
value="/jsp/manager/managerMiddle1.jsp"/>"/>
 </definition>  	

Unfortunately, this doesn't work. Can somebody help? Thanks.

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


Re: Tiles questions

Posted by "Alberto A. Flores" <aa...@gmail.com>.
That's because the tiles inheritance you are trying to use doesn't make 
sense. The managerPage1 tile does NOT have a "middle" element in the 
parent tile (which is defined in the managerBody tile). You probably 
need to use a different strategy, perhaps check the role and forward to 
the proper tile (tile layout for managers and tile layout for non-managers).

Zhang, Larry (L.) wrote:
> 
> I have a mainLayout which has a header, body and footer.(and thus I have
> 4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice
> that body.jsp will be different for each different screen page).
> 
> One setting can be of:
> 
> <!-- shared by all -->
> <definition name="mainLayout" path="/jsp/common/mainLayout.jsp">
>         <put name="header" value="/jsp/common/header.jsp" />
> 	  <put name="body" value="" />
>         <put name="footer" value="/jsp/common/footer.jsp" />
> </definition>
> 
> <!-- this is different from each screen page -->
> <definition name="viewemployee" extends="mainLayout">
>    <put name="body" value="/jsp/employee/employee.jsp" />
> </definition>  	
>     
> 
> Then I have a further requirement: Manager pages's body has left, middle
> and right. All manager pages will have common left and right, but middle
> will be different. So I define the managerBody like
> 
> 	<!-- every manager page shares this -->
> 	 <definition name="managerBody"
> path="/jsp/common/managerBodyLayout.jsp">
> 		<put name="left" value="/jsp/common/left.jsp"/>
> 		<put name="middle" value=""/>
> 		<put name="right" value="/jsp/common/right.jsp"/>
> 	</definition>
> 
> Then if I have managerPage1, I can define as:
> 
>  <definition name="managerPage1" extends="mainLayout">
>       	<put name="body" value="managerBody"/>
> 		<put name="middle"
> value="/jsp/manager/managerMiddle1.jsp"/>"/>
>  </definition>  	
> 
> Unfortunately, this doesn't work. Can somebody help? Thanks.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

-- 

Alberto A. Flores
http://www.linkedin.com/in/aflores



Tiles questions

Posted by "Zhang, Larry (L.)" <lz...@ford.com>.

I have a mainLayout which has a header, body and footer.(and thus I have
4 jsps, mainLayout.jsp, header.jsp, body.jsp, and footer.jsp, and notice
that body.jsp will be different for each different screen page).

One setting can be of:

<!-- shared by all -->
<definition name="mainLayout" path="/jsp/common/mainLayout.jsp">
        <put name="header" value="/jsp/common/header.jsp" />
	  <put name="body" value="" />
        <put name="footer" value="/jsp/common/footer.jsp" />
</definition>

<!-- this is different from each screen page -->
<definition name="viewemployee" extends="mainLayout">
   <put name="body" value="/jsp/employee/employee.jsp" />
</definition>  	
    

Then I have a further requirement: Manager pages's body has left, middle
and right. All manager pages will have common left and right, but middle
will be different. So I define the managerBody like

	<!-- every manager page shares this -->
	 <definition name="managerBody"
path="/jsp/common/managerBodyLayout.jsp">
		<put name="left" value="/jsp/common/left.jsp"/>
		<put name="middle" value=""/>
		<put name="right" value="/jsp/common/right.jsp"/>
	</definition>

Then if I have managerPage1, I can define as:

 <definition name="managerPage1" extends="mainLayout">
      	<put name="body" value="managerBody"/>
		<put name="middle"
value="/jsp/manager/managerMiddle1.jsp"/>"/>
 </definition>  	

Unfortunately, this doesn't work. Can somebody help? Thanks.

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