Found some instructions on using tiles with JSF without struts, so I should be ok
http://forum.exadel.com/viewtopic.php?t=968
URL: http://www.exadel.com/downloads/jsf/examples/jsf-tiles.war (2.14M)
This short example shows how use JSF together with Tiles. All you have to do is add struts.jar from the Struts1.1 distributive to your classpath. Including struts.jar does not mean that Struts itself is required to use with Tiles. Tiles packages are distributed inside the struts.jar. No other funclionality of the Struts Framework will be involved.
Useful Tips:
1. This is a snippet from web.xml that makes Tiles enabled:
Code:
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>TilesServet</servlet-name>
<servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
Pay attention to the load-on-startup tag. Tiles Servlet should be loaded after the Faces Servlet. It is important.
2. tiles-defs.xml file is a standard Tiles definitions file. You can use several of them. Use comma separated string to define such files for the definitions-config.
3. Use flush="false" for the tiles:insert tag is you use it inside the f:view
4. Use f:subview if you use tiles inside the f:facet. For example:
Code:
<f:facet name="header">
<f:subview id="header">
<tiles:insert definition="page.header" flush="false"/>
</f:subview>
</f:facet>
5. Never include f:view inside another f:view
6. You cannot forward directly to the tiles, like in the Struts. So, anyway, the faces-config file should contain a pages as a view.
Sunday, October 31, 2004
Subscribe to:
Post Comments (Atom)
Popular Posts
- AS400 Job Scheduler
- Recover or reset QSECOFR passwords
- Make a Home made, open source mp3 Player
- A free fully functional database is yours with Microsoft's SQL Server Express
- AS400 Jobs: Do you have a job at the moment?
- Sending and receiving email on i5/os - QtmmSendMail
- 3 fires up high-speed Super 3G network, News at CNET.co.uk
- AS400 API - QCMDEXC - Execute Command
- API Example - Deleting Old Spooled Files
- UDATE and *DATE in AS400 RPG
No comments:
Post a Comment