J
Jun
I followed the "Solution 6" in
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
That is,
- place tileDefinitions.xml under WEB-INF
<?xml version="1.0" encoding="ISO-8859-1"?>
<component-definitions>
<definition name="aDef" path="/layout.jsp">
<put name="header" value="/header.jsp"/>
<put name="footer" value="/footer.jsp"/>
<put name="body" value="/aBody.jsp"/>
</definition>
</component-definitions>
- change web.xml to add
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tileDefinitions.xml</param-value>
</init-param>
- create all the jsps
- create Action DoFirst class
- add mapping
<action path="/a" type="com.malani.struts.action.DoFirst">
<forward name="success" path="aDef"/>
</action>
But when I invoked a.do, I got a "404" about
"The requested resource (/TileTest/aDef) is not available."
It seemed that the "aDef"...
Can anyone explaint how this thing is mapped?
How does the struts make use of the tileDefinitions.xml?
"aDef" appears as content "path" of forward in action mapping but
how this related to the "component-definitions" that is loaded
when web server started?
thanks
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
That is,
- place tileDefinitions.xml under WEB-INF
<?xml version="1.0" encoding="ISO-8859-1"?>
<component-definitions>
<definition name="aDef" path="/layout.jsp">
<put name="header" value="/header.jsp"/>
<put name="footer" value="/footer.jsp"/>
<put name="body" value="/aBody.jsp"/>
</definition>
</component-definitions>
- change web.xml to add
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tileDefinitions.xml</param-value>
</init-param>
- create all the jsps
- create Action DoFirst class
- add mapping
<action path="/a" type="com.malani.struts.action.DoFirst">
<forward name="success" path="aDef"/>
</action>
But when I invoked a.do, I got a "404" about
"The requested resource (/TileTest/aDef) is not available."
It seemed that the "aDef"...
Can anyone explaint how this thing is mapped?
How does the struts make use of the tileDefinitions.xml?
"aDef" appears as content "path" of forward in action mapping but
how this related to the "component-definitions" that is loaded
when web server started?
thanks