Question

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 :)

Was it helpful?

Solution

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top