some background info:
I am using simple Spring Theming right now. The spring controller code pulls the appropriate view, ex: WEB-INF/view/appropriateView.jsp. The views all have the same basic html with classes that a design .css file can theme. The view sets the design file via spring:theme code like so: <link rel="stylesheet" type="text/css" href="<spring:theme code="css.layout_style_sheet"/>" />. The WEB-INF/classes/theme-theTheme.properties file will define what css file to use via: css.layout_style_sheet=theme960/960.css.
Thats all fine and dandy for themes that are based on the same css framework (like using 960.css, 1024.css, 800.css, etc for the 960 framework) and the html will looks exactly the same minus 1 different css file. But now we want to use Twitter Bootstrap or Zurb Foundation or 960, etc. On appropriateView.jsp, TwitterBoostrap will want to use different js files to include to use its framework vs Foundations. Also the html content will be different since they use different html data-attribute tags to let its framework know how to present things visually plus the markup may be totally different as well: <div class="navbar"><div class="navbar-inner">... vs <nav class="tab-bar"> <section class="left-small">...
My best idea was to have different files for each main css framework like appropriateView-twitter.jsp, and appropriateView-foundation.jsp and in the spring controller code pull the appropriate one. and inside that file then there may be different 'includes' for each framework (guess can just pass a variable to get it like datepicker-${cssfrawework}.jsp). like datepicker-twitter.jsp, datepicker-foundation.jsp and radiobuttongroup-twitter.jsp, radiobuttongroup-foundation.jsp. maybe the design wants to add a different number of css/js-plugin files in addition to those included by the base cssframework template.
My question is now, is there a better way to do theming like this via more advanced java theming/template engines like Velocity, SiteMesh, Mustache, ThymeLeaf,etc Vs my idea above? and if so, any examples on the web to show an advanced theming system like this in action? It would be great if designers could work on these files via in their Designer IDE of choice (guess this is what ThymeLeaf calls 'Natural Templating').