tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Stewart <Brian.Stew...@ahom.com>
Subject Tiles Definition Files From a Jar or War
Date Thu, 22 Oct 2009 16:12:03 GMT
What is the proper way to load a Tiles2 definitions file from a jar file or another war file
on the classpath?  I would like to move a "common" set of definitions that will be extended
by all other web applications into a single location rather than having each application have
it's own copy of this reusable file.

Using the following code which works...
<context-param>
	<param-name>
		org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
	<param-value>
		/WEB-INF/classes/config/tiles/tiles-ar-default.xml, /WEB-INF/classes/config/tiles/tiles-ar-security.xml,
/WEB-INF/classes/config/tiles/tiles-ar-search.xml
	</param-value>
</context-param>


I'd like to do something like this...
<context-param>
	<param-name>
		org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
	<param-value>
		classpath:config/tiles/tiles-common-default.xml, /WEB-INF/classes/config/tiles/tiles-ar-security.xml,
/WEB-INF/classes/config/tiles/tiles-ar-search.xml
	</param-value>
</context-param>
Where config/tiles/tiles-common-default.xml is just a renamed version of tiles-ar-default.xml
which is located directly on the root classpath of an included jar or accessible war.

The definitions must be extendable across definition configuration files and addressable via
Struts2.  
<action name="searchAR_*" method="{1}"  
			class="com.us.ar.action.arlist.FetchArAction">
			<result type="tiles">layout.arList</result>
... currently works and I need it to continue to work.

I tried using the context param name: org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
but Struts2 couldn't find the definitions that it created (successfully).

Regards,
Brian Stewart 
mrbcstewart@yahoo.com

This message is confidential, intended only for the named recipient
and may contain information that is privileged or exempt from
disclosure under applicable law.  If you are not the intended
recipient, you are notified that the dissemination, distribution or
copying of this message is strictly prohibited.  If you receive
this message in error, or are not the named recipient, please
notify the sender at the email address listed above.


Mime
View raw message