Since you're using the servlet and not the listener, have you added the
servlet mapping like the following?
Easy to overlook!
<servlet-mapping>
<servlet-name>tiles</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
The listener is a good (and seemingly better option):
<context-param>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>
...
<listener>
<listener-class>org.apache.tiles.web.startup.TilesListener</listener-class>
</listener>
Cheers
shahab wrote:
>
> Hi: I need some help with using tiles 2 with Struts 2.
>
> I have configured tiles servlet in web.xml as follows - (i am using Spring
> listener)
> <servlet>
> <servlet-name>tiles</servlet-name>
>
> <servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
> <init-param>
> <param-name>
>
> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
> </param-name>
> <param-value>
> /WEB-INF/tiles-defs.xml
> </param-value>
> </init-param>
> <load-on-startup>2</load-on-startup>
> </servlet>
>
> During start up, tiles-defs.xml is being read. However, when I see a blank
> screen when the page is rendered. The jsp has the following -
> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
> <tiles:insertDefinition name="test.definition" />
>
> (test.definition is defined in tiles-defs.xmls as follows -
> <definition name="test.definition" template="/layout.jsp">
> <put-attribute name="title" value="This is the title."/>
> <put-attribute name="header" value="/header.jsp"/>
> <put-attribute name="body" value="/body.jsp"/>
> </definition>
>
> I have layout.jsp, header.jsp and body.jsp in the same directory where the
> jsp is. They are not under WEB-INF. I have a separate directory for web.
>
> (In a pdf book from InfoQ, the author says that, the result type of an
> action should be stated as "tiles". i tried that, but i got the following
> error -
> There is no result type defined for type 'tiles')
>
> Please help.
>
--
View this message in context:
http://www.nabble.com/issues-with-tiles-with-struts-2-tf4041172.html#a11498977
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]