Struts - Tiles

Programming, for all ages and all languages.
Post Reply
Rex

Struts - Tiles

Post by Rex »

*************** JAVA - STRUTS *************
Hi,

i have a doubt regarding Struts-Tiles concept. i am basically designing a page using struts framework. im using JBoss as my server. And for all my pages i have a common header and footer, so i went for tiles.

i have defined this header and footer in a tile and inherit them as required.

in my jsp pages i am using struts html,bean,logic tag libraries. and so in header and footer pages.i have included all these tag libs in my header,footer and in all my other pages(body).

   <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
   <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

so in my case a page means..

<header tile>
<body>
<footer tile>

The doubt is whenever i load a page(includes all the above 3)... for each tile the tag libs are initialized. say for header the struts-html.tld is initialized again for body the same tile is getting initialized and for footer again the same tile is initialized. its because i have included them all my 3 tiles. but if i remove the includes in any of my tile( assuming its all initialized in my header). it throws an error.
so is it neccessary to include in all my tiles or can i initialize it globally and use it across all my pages.

Thanks in advance..

Thanks,
Rex
Post Reply