Hi folks,
I am trying to integrate struts 1.x with tiles 1.1 but I am facing problems!
Here's snippet of struts-config.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_3.dtd">
<struts-config>
<!-- ..... -->
<!-- ..... -->
<action path="/listcategories"
type="com.wrox.begjsp.ch28.bookstore.controller.ListCategoriesAction"
scope="request">
<forward name="success" path="list.categories"/>
</action>
<!-- ..... -->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-debug" value="2" />
<set-property property="definitions-parser-details" value="2" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
</struts-config>
And here's snippet of tiles-defs.xml (referenced from struts-config.xml):
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="view.abstract" path="/WEB-INF/jsp/layout/standard-layout.jsp">
<put name="header" value="/WEB-INF/jsp/tiles/header.jsp" />
<put name="menu" value="bookstore.menu" />
<put name="base" value="/WEB-INF/jsp/tiles/base.jsp" />
</definition>
<definition name="list.categories" extends="view.abstract">
<put name="body" value="/WEB-INF/jsp/tiles/category-list.jsp" />
</definition>
</tiles-definitions>
When com.wrox.begjsp.ch28.bookstore.controller.ListCategoriesAction Action succeed, we get some strange exception stating that, the path attribute cannot have a value doesn't starting by / which is "list.categories", which means, It cannot interpret that is not a path but a definition defined in tiles-defs.xml......
I am not a tiles guru, but I think it should know how to interpret this value!
need you help of how to configure things out!
Thanks.