|
From: Alef A. <al...@jt...> - 2003-07-11 09:57:42
|
<quote>BTW, how exactly does your TilesView work? As far as I know, Tiles can be largely used as tag library, without the need for dedicated integration. The most interesting usage for integration is probably with content definitions - a la http://www.javaworld.com/javaworld/jw-01-2002/jw-0104-tilestrut.html Solution 6, but with Spring instead of Struts. Do you intend to offer a solution for this, basically a Spring View that renders such content definitions that consist of Tiles components?</quote> Exactly! That's what it already does. I've made the TilesViewResolver to be configurable from the xxx-servlet.xml (see code below). It searches for the factory and stuff. The TilesView basically is the same as the integration in Struts, where you can 'forward' to a definition using the ActionForward. It's kind of simple. The only thing that needs to be tested a little bit is the Tiles Controller concept (where you can attach a controller to each tile, that retrieve data for this specific tile). I hardly ever use this, but well, other people might. <quote>Regarding code structure, I'm not entirely sure why you need a TilesViewResolver - what resolution functionality does it add? Wouldn't TilesView instances, each defining a content page as arranged Tiles components, work too when they get configured via ResourceBundleViewResolver or XmlViewResolver?</quote> Hmm, you might be right here... I'll have a look into that... Anyway, I've attached the files like they are right now... Just FYI. Don't mind the packagenames and stuff, documentation still needs to be done... Any suggestions? Always welcome... <quote>I'm looking forward to your code! Thanks for your efforts!</quote> No problem, It's a cool framework, worth of adding features in order to make it fit my (and other's) needs more... ---- xxx-servlet.xml ---- <bean id="viewResolver" class="jteam.jbosssupport.web.util.TilesViewResolver"> <property name="factoryClass"> <value>org.apache.struts.tiles.xmlDefinition.I18nFactorySet</value> </property> <property name="definitions"> <props> <!-- this is a little weird, definitionfiles mapped to descriptions --> <prop key="/WEB-INF/defs/general.xml">The General resources</prop> <prop key="/WEB-INF/defs/widgets.xml">Some often used widgets</prop> <prop key="/WEB-INF/defs/administrator.xml">Some often used widgets</prop> <prop key="/WEB-INF/defs/customer.xml">Customer definitions</prop> <prop key="/WEB-INF/defs/templates.xml">Often used templates</prop> </props> </property> </bean> |