Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Having a problem with struts-tiles

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add tiles plugin to struts config

 
Tong Wang
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic