You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mehdi Bahribayli <ba...@yahoo.com> on 2006/08/30 15:03:53 UTC

[tiles] page content

* Use a fixed length font to see this message in correct layout.

In order to create a layout like this, I use six elements.

+---------------------------+
|        Header             |
+------+--------------------+
 |      |                    |
|      |                    |
| Menu |      Body          |
|      |                    |
|      |                    |
|      |                    |
+------+--------------------+
 |        Body               |
+---------------------------+
 
1. A definition in tiles-def.xml :
...
    <definition name="tiles:master" page="/layouts/master.jsp">
        <put name="header" value="/subviews/header.jspf"/>
        <put name="menu" value="/subviews/menu.jspf" /> 
        <put name="footer" value="/subviews/footer.jspf"/>
    </definition>
...
 2. A page at /subviews/header.jspf (header).
 3. A page at /subviews/footer.jspf (footer).
 4. A page at /layouts/master.jsp. (layout).
5. A page at /views/welcome.jsp (page).
6. A page at /subviews/welcome-body.jspf(body).

You can see that all of the above mentioned elements can be used over and over but 6th element (the body) will be used just once as body of a specific page (5th element). Thus there is no need to define it as a separate tile. So how can I integrate 5th and 6th element?

 
 
 
 			
---------------------------------
Get your own web address for just $1.99/1st yr. We'll help. Yahoo! Small Business.

Re: [tiles] page content

Posted by Antonio Petrelli <br...@tariffenet.it>.
Mehdi Bahribayli ha scritto:
> * Use a fixed length font to see this message in correct layout.
>
> In order to create a layout like this, I use six elements.
>
> +---------------------------+
> |        Header             |
> +------+--------------------+
>  |      |                    |
> |      |                    |
> | Menu |      Body          |
> |      |                    |
> |      |                    |
> |      |                    |
> +------+--------------------+
>  |        Body               |
> +---------------------------+
>  
> 1. A definition in tiles-def.xml :
> ...
>     <definition name="tiles:master" page="/layouts/master.jsp">
>         <put name="header" value="/subviews/header.jspf"/>
>         <put name="menu" value="/subviews/menu.jspf" /> 
>         <put name="footer" value="/subviews/footer.jspf"/>
>     </definition>
> ...
>  2. A page at /subviews/header.jspf (header).
>  3. A page at /subviews/footer.jspf (footer).
>  4. A page at /layouts/master.jsp. (layout).
> 5. A page at /views/welcome.jsp (page).
> 6. A page at /subviews/welcome-body.jspf(body).
>
> You can see that all of the above mentioned elements can be used over and over but 6th element (the body) will be used just once as body of a specific page (5th element). Thus there is no need to define it as a separate tile. So how can I integrate 5th and 6th element?
>   

I think (but I didn't try) that you can do, in welcome.jsp:

<tiles:insert name="tiles:master">
  <tiles:put name="body" value="/subviews/welcome-body.jspf" />
</tiles:insert>

The attribute "body" will be filled only in a specific request.
Let me know if it works.

Ciao
Antonio


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