tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Hepple" <m...@impresariostudios.com>
Subject Configuring Tiles for a modular applications
Date Tue, 16 Jul 2013 01:26:19 GMT


I'm attempting to make a configuration which will allow me to define modules
at build-time for distribution to various customers. My main client requires
'all' the features, and other clients require a subset of features. It's an
existing application based on Tiles 2.2.2 (although upgrading to 3 if
necessary is fine).


Based on the documentation I assumed I could do something like this:




<definition name="myapp.homepage" template="/layouts/classic.jsp">

  <put-attribute name="header" value="/tiles/banner.jsp" />

  <put-attribute name="menu" value="/tiles/common_menu.jsp" />

  <put-attribute name="body" value="/tiles/home_body.jsp" />

  <put-attribute name="footer" value="/tiles/credits.jsp" />







<tiles:insertDefinition name="moduleA" ignore="true" />





<definition name="moduleA" template="/moduleA/module.jsp">


Now, if I do that, and include module-a.xml, everything works fine. If I
remove module-a.xml though, I get a runtime exception (as if the
ignore="true" wasn't there).


I did some digging, and found this:




which I'm guessing means that insertDefinition in 2.2.2 suffers the same
fate. No problem I thought - time to get up to date.. however it seems that
Tiles 3.x removes support for ignore=true in definitions? 




So. I'm stumped! Can anyone think of an intelligent way to handle the
non-existence of features in a meaningful manner? Basically all I want is
the ability to do (in pseudo-code)


if moduleA exists:

                                insert module.jsp


                                do nothing


Thanks for reading, appreciate any help you can provide.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message