tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Schröder <simon.v...@gmx.de>
Subject neccessary stepts to use Struts 2+FreeMarker+Tiles2.1
Date Tue, 28 Oct 2008 15:44:33 GMT

hi,

i'm in the precess of including Tiles 2 to my
Struts2+FreeMarker(+ServletAPI2.5)-project.
Things i did:
-add libs: 
struts2-tiles-plugin-xxx.jar, 
tiles-core-xxx.jar, 
tiles-api-xxx.jar, 
tiles-servlet-xxx.jar,
tiles-jsp-xxx.jar,
commons-beanutils-xxx.jar, 
commons-digester-xxx.jar, 
commons-logging-api-xxx.jar
spring-xxx.jar

-add listener in web.xml:
<listener>

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

-added the tiles-Result to my my-struts-default.xml (i know, i could habe
just extended tiles-default but i want to make tiles default="true" anyway).

-added an WEB-INF/tiles-defs.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
  <definition name="*" template="/layout/simpleLayout.ftl">
    <put-attribute name="body" value="{1}" />
  </definition>  
</tiles-definitions>

-/layout/simpleLayout.ftl doesn't do anything usefull but i should provide
the HTML-Page with an <!-- test -->-String. It looks like this:
<!-- test -->
<@tiles.insertAttribute name="body" />


This results in the following error message:
...
INFO: Initializing Tiles2 container. . .
28.10.2008 15:59:13 org.apache.tiles.context.ChainedTilesContextFactory init
WARNUNG: Cannot find TilesContextFactory class
org.apache.tiles.portlet.context.PortletTilesContextFactory
28.10.2008 15:59:13 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener
instance of class org.apache.struts2.tiles.StrutsTilesListener
java.lang.IllegalStateException: RendererFactory not specified
	at
org.apache.tiles.impl.BasicTilesContainer.init(BasicTilesContainer.java:142)
	at
org.apache.tiles.factory.TilesContainerFactory.initializeContainer(TilesContainerFactory.java:271)
        ...

Apart from this error there are other things i'm not sure about:
-does Struts/Tiles find WEB-INF/tiles-defs.xml or do i have to set the
BasicTilesContainer.DEFINITIONS_CONFIG parameter?
-in simpleLayout.ftl do i have to include the tiles-jsp-lib myself (<#assign
tiles=JspTaglibs["???"]>
) or does the tiles-plugin do that? If i have to do it myself what is the
(local) address?
-- 
View this message in context: http://www.nabble.com/neccessary-stepts-to-use-Struts-2%2BFreeMarker%2BTiles2.1-tp20209482p20209482.html
Sent from the tiles users mailing list archive at Nabble.com.


Mime
View raw message