wood burning stoves 2.0*
The moose likes Struts and the fly likes Having a problem with struts-tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Having a problem with struts-tiles" Watch "Having a problem with struts-tiles" New topic
Author

Having a problem with struts-tiles

Tong Wang
Ranch Hand

Joined: Jun 20, 2005
Posts: 44
Hi,

I am learning tiles and when I try to run my first tiles web app, I got an error:

Path display.welcome does not start with a "/" character

where "display.welcome" is a definition in my tiles-defs.xml. My struts action mapping looks like this:

<action path="/welcome" forward="display.welcome"/>

And I do have the tiles plugin in my struts-config.xml.

Can someone help me figure out what's wrong?

Thanks,
Tong
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
Add tiles plugin to struts config

Tong Wang
Ranch Hand

Joined: Jun 20, 2005
Posts: 44
Thanks for the reply. I had that part in my struts config, what I really missed is the following line:

<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>

Can someone tell me what this does? Does it handle the mapping between the tiles definitions and the forwards?
Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
This processor subclasses the Struts RequestProcessor in order to intercept calls to forward or include. When such calls are done, the Tiles processor checks if the specified URI is a definition name. If true, the definition is retrieved and included. If false, the original URI is included or a forward is performed.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Having a problem with struts-tiles
 
Similar Threads
Enabling/Installing Struts Tiles
forwarding between action classes
Tiles problem with opening response in excel
Struts-Tiles Reloading Problem
[TILES] How to include an action as body in a definition [SOLVED]