aspose file tools*
The moose likes Struts and the fly likes question in tiles loading behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "question in tiles loading behavior" Watch "question in tiles loading behavior" New topic
Author

question in tiles loading behavior

aleah de guzman
Greenhorn

Joined: Jun 06, 2006
Posts: 15
in tiles definition, for example i created a layout with header and a dynamic body, this body can be page1 or page2. if im in page1 and i go to page2, will the header.jsp be loaded again or just the body?

<definition name="layout1" path="/layout/template.jsp">
<put name="header" value="/tiles/header.jsp"/>
<put name="body" value="{body}"/>
</definition>

<definition name="tiles.page1" extends="layout1">
<put name="body" value="/pages/riOut.jsp"/>
</definition>

<definition name="tiles.page2" extends="layout1">
<put name="body" value="/pages/coverDetails.jsp"/>
</definition>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Even though tiles allows you to create a composite page consiting of smaller parts, in the end, the page created is still a single HTML page. So, the answer to your question is that any time you display a different body, the header will be redisplayed also. It is after all a single page as far as the web container is concerned.


Merrill
Consultant, Sima Solutions
aleah de guzman
Greenhorn

Joined: Jun 06, 2006
Posts: 15
is there a way that it could behave as frames? coz i dont want to reload the header everytime i do submit on the body. the header's content is not being affected by any transactions done in the body.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you want it to behave as frames, I'd suggest you just use frames rather than tiles.
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
merrill is right.

loading a complete page per request is pretty much how web pages work inherently.

you can think about frames (which execute one request per frame as well, but give you control about the reload), you can also think about caching, maybe also about some asynchronous ajax technology (buzzword alarm!).

i'm using tiles with frames, the benefit is rather low compared with a no frame solution. and frames are really old school.

i'd suggest that you dont use frames. should you run into performance problems later, you can add things like caches then.

jan
 
Consider Paul's rocket mass heater.
 
subject: question in tiles loading behavior