A question about "integration of Struts and Tiles"

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
 
W

Wendy S

Jun said:
http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html
But when I invoked a.do, I got a "404" about
"The requested resource (/TileTest/aDef) is not available."

What's in the log files? (Turn logging up to debug, the Tiles classes are
quite verbose!) That looks like the Tiles plugin didn't load or didn't
process your tiles-defs.xml file (or whatever you're calling it.) Rather
than see that aDef is a tiles definition, it's using it as a "normal" URI.

I remember following that same tutorial. Google this group or clj.help and
see if you can find any other posts referring to this tutorial. I can't
remember whether I had a problem with it or not.

Do you also have this in struts-config?
<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>

(change the name of tiles-defs.xml if you're using something else)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top