8

there doesn't seem to be a simple way to use Tiles 2.1 or 2.2 with Struts2 with the existing struts2-tiles plugin. I need to use the tiles wildcards functionality in my project where the tiles.xml became unmaintainable.

Is there any way at all to set up tiles 2.1 or 2.2 with struts2? How?

Thank you,

Bozo

bozo
  • 947
  • 1
  • 13
  • 33
  • Please see: http://stackoverflow.com/questions/10050433/ognl-and-wildcards-working-in-tiles-definitions-with-struts2-tiles-plugin/10067367#10067367 for how to get Tiles 2.2.2 working with the current release of struts2. – Quaternion Apr 28 '12 at 16:24

2 Answers2

6

I suggest you to use Sitmesh decoration framework for strut2

Vinayak Bevinakatti
  • 40,205
  • 25
  • 108
  • 139
  • Update: there is now Tiles 2.2.2 (GA) available and Struts 2.2.3. And it seems the latest Struts ships with tiles libs 2.0.6. Has anyone managed to integrate these latest versions of Struts2 and Tiles2? I am not interested in Sitemesh since this is a big existing tiles based project. – bozo Jun 24 '11 at 05:14
  • I was able :), I use the last Tiles libs and Struts 2.2.3 in my web applications – Denees Jun 24 '11 at 14:04
  • Have you changed the existing struts2-tiles plugin to do it? What's the cookbook here? :) – bozo Jun 24 '11 at 17:12
5

As far as I'm aware current struts2 major release ships with tiles 2.0.6. Wildcard support has been added since tiles 2.1 so I'm afraid you can not use wildcards with current version of plugin.
If you want to setup the tiles 2.1+ with struts2 anyway you have to tweak the plugin yourself or wait for the next release.
You also might wanna consider using a preparer in case you want to set some dynamic values to you definition. Hope this helps. you can check this issue for tiles plugin which is unresolved yet.

doctrey
  • 1,227
  • 1
  • 12
  • 25
  • Are you aware, has anyone integrated the newer version of tiles2 with Struts in some project, somewhere? – bozo Jun 24 '11 at 17:11
  • @bozo According to the link I gave you above it's planned for integration, but don't know when it's gonna be released. – doctrey Jun 24 '11 at 18:37
  • I'm pretty sure I have such a project... So I think there is one somewhere. I'm not trying to be cryptic, I asked a very similar question and someone sent me their project I just found it difficult to decipher at the time and this question prompted me to look for it. It must be at home... – Quaternion Jun 24 '11 at 18:57
  • If you find it please send it along. :) – bozo Jun 30 '11 at 06:20
  • [Here](http://letsbegincharity.blogspot.com/search/label/Struts2-Tiles) is a working example in Netbeans. – coding_idiot Sep 21 '11 at 00:06