2

So I'm working on a project using Spring MVC 3 and we tried SiteMesh 2.4.2 as a templating mechanism but it ended up having conflicts with Spring so today I'm trying to replace SiteMesh with Tiles 2.2.2 and it seems there's a lot more work to do.

I might have missed something but from every how-to/guides I've read, it seems you have to add a definition in your tiles.xml file for every page that is going to be decorated with your layout.

Is there a simpler/generic way to do this? Because we have like 50 pages, FOR NOW, so it might be a pain in the ass to have to add a definition every time we add some page. Using SiteMesh it was just all about declaring a base URL that would be intercepted by SiteMesh and it would then decorate any page that comes out of that URL. This might as well be the reason of the conflicts it has with Spring MVC 3, but it was so easy to use and nice that I expect any templating mechanism to do the same.

Any insight on how I can achieve this, if this is even possible ?

Thank you!

PS: Feel free to say if you think it's not possible but are not sure or what ever in comment section :)

Michael De Keyser
  • 787
  • 1
  • 17
  • 45
  • Well actually it's SiteMesh 3 that was first flagged as having conflicts with Spring MVC 3, but it seems the same conflicts are also in 2.4.2 since the same behavior was witnessed in our project... Sadly, Tiles is my last hope. – Michael De Keyser May 23 '13 at 23:59
  • Maybe could it be easier to fix the conflict what you have than to choose similar technology? or ask here about the error? – Alex May 24 '13 at 01:12

1 Answers1

2

There's absolutely no reason to need a new tiles definition for every page.

Here's a tutorial that will help you with

  • spring to tiles integration,
  • definitions with wildcards,
  • implementing a fallback pattern using the OptionsRenderer, and
  • definitions composition.

http://tech.finn.no/the-ultimate-view-tiles-3/

mck
  • 1,152
  • 10
  • 10