• Post Reply Bookmark Topic Watch Topic
  • New Topic

How use Tiles in JSF?  RSS feed

 
sundar ganapathy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to put Tiles layout in my existing JSF project.
Steps i followed are listed below:

1. updated web.xml as follows
<!-- Added to inform JSF about TILES configuration -->
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>

2. updated faces-config.xml as follows
<!-- Added for informing JSF about TILES configuration -->
<application>
<view-handler>
org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl
</view-handler>
<message-bundle>resources.vcf-resources-labels</message-bundle>
</application>

3. tiles-defs.xml as follows
<tiles-definitions>

<definition name="layout.tiles" path="/jsp/template/layout.jsp">
<put name="header" value="/jsp/template/header.jsp" />
<put name="topmenu" value="/jsp/template/topmenu.jsp" />
<put name="leftmenu" value="/jsp/template/leftmenu.jsp" />
<put name="content" value="/jsp/template/empty.jsp" />
<put name="messages" value="/jsp/template/messages.jsp" />
<put name="footer" value="/jsp/template/footer.jsp" />
</definition>
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!