Here's how to use Tiles in your own application:
struts-tiles.jar
is available in
the WEB-INF/lib
directory of your web application.
init-param
to the Action
Servlet definition in web.xml:<init-param> <param-name>chainConfig</param-name> <param-value>org/apache/struts/tiles/chain-config.xml</param-value> </init-param>
<plug-in className="org.apache.struts.tiles.TilesPlugin"> <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/> </plug-in>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
WARNING - Do NOT add
tiles.jar
to the classpath of your servlet container in
an attempt to avoid placing it in the /WEB-INF/lib
directory of each individual web app! Doing so will cause problems with
ClassNotFoundException
exceptions.
For most containers, you need only to:
/webapp
directory
to your containers webapps
directory.