--- Pedro-1 <[EMAIL PROTECTED]> wrote:
> Could some one give me a pointer to a simple example
> showing all the configuration files, and where to
put
> them?

-- web.xml fragment

<!-- 
  - If you want to use tiles config files other
  - than the default /WEB-INF/tiles.xml you can
  - configure them with a context-param.
  -
  - This is optional but I think it helps a lot.
  -->
<context-param>
  <param-name>definitions-config</param-name>
  <param-value>
    /WEB-INF/tiles.xml,
    /WEB-INF/classes/com/foo/bar/bar-tiles.xml,
    /WEB-INF/classes/com/foo/baz/baz-tiles.xml
  </param-value>
  <description>
    CSV list of Tiles 2.0 configuration files.
  </description>
</context-param>

<listener>
  <listener-class>
    org.apache.struts2.tiles.StrutsTilesListener
  </listener-class>
</listener>

-- tiles.xml fragment

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles
Configuration 2.0//EN"
   
"http://struts.apache.org/dtds/tiles-config_2_0.dtd";>

<tiles-definitions>
  <definition name="/sanityCheck.page"
template="/WEB-INF/jsp/sanityCheck.jsp">
    <put name="title" value="Sanity Check"/>
  </definition>

  <definition name="layout"
template="/WEB-INF/jsp/components/layout.jsp">
    <put name="title" value="!!! DEFAULT TITLE !!!" />
  </definition>

  <definition name="/home.page" extends="layout">
    <put name="title" value="Home" type="string" />
    <put name="body" value="/WEB-INF/jsp/home.jsp" />
  </definition>

  <!-- Etc. -->
</tiles-definitions>

-- layout.jsp (just to show insertions of attributes)

<%@ taglib prefix="tiles"
uri="http://struts.apache.org/tags-tiles"%>
<html>
  <head>
    <title><tiles:getAsString name="title"/></title>
  </head>
  <body>
    <tiles:insertAttribute name="body" />
  </body>
</html>

d.



 
____________________________________________________________________________________
Don't get soaked.  Take a quick peek at the forecast
with the Yahoo! Search weather shortcut.
http://tools.search.yahoo.com/shortcuts/#loc_weather

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to