tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Stewart <Brian.Stew...@ahom.com>
Subject Using multple Tiles configs from jar file
Date Thu, 22 Apr 2010 19:20:56 GMT
I am trying to load four tiles configurations, two from a jar file, and two within the project.
 Then I have Struts2 forwarding to the definitions.  The server now starts up OK, but I get
an error when forwarding from S2 to T2: org.apache.tiles.definition.NoSuchDefinitionException:
layout.cmnQueue

Here is my Tiles Configuration:
	<context-param>
		<param-name>
			org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG
		</param-name>
		<param-value>
			/WEB-INF/classes/config/tiles/tiles-cmn-queue.xml,
			/WEB-INF/classes/config/tiles/tiles-cmn-detail.xml,
			classpath:/config/common/tiles/tiles-common-default.xml,
			classpath:/config/common/tiles/tiles-common-security.xml
        </param-value>
	</context-param>
	<context-param>  
		<param-name>org.apache.tiles.context.AbstractTilesApplicationContextFactory</param-name>
 
		<param-value>  
			org.apache.tiles.servlet.context.wildcard.WildcardServletTilesApplicationContextFactory
 
		</param-value>  
	</context-param>  

    <listener>
		<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
	</listener>
	<listener>
		<listener-class>com.ahom.cmn.util.SessionListener</listener-class>
	</listener>

experiment.jar\config\common\tiles\tiles-config-default.xml exists
experiment.jar\config\common\tiles\tiles-common-security.xml exists
I have included spring-web for the wildcard configuration... <dependency org="org.springframework"
name="spring-web" rev="2.5.6"/>

The definition it can't find exists in tiles-cmn-queue.xml..
	<definition name="layout.cmnQueue" 		extends="layout.base">
		<put-attribute name="title"  		value="CMN"/>
		<put-attribute name="header"  	value="layout.cmnQueue.header.fragment" />
		<put-attribute name="javascript"	value="/WEB-INF/webtiles/queue/javascripts.jsp" />
		<put-attribute name="body-content" 	value="/WEB-INF/webtiles/queue/displayQueue.jsp"/>
	</definition>

layout.base is defined in tiles-config-default.xml.. 
	<definition name="layout.base" 	template="/WEB-INF/webtiles/common/layout/baseLayout.jsp">
		<put-attribute name="javascript"  	value="" />
		<put-attribute name="bodyClassId"  	value="pagebody"/>
		<put-attribute name="title"  		value="ahp"/>
		<put-attribute name="banner" 		value="/WEB-INF/webtiles/common/banner.jsp" />
		<put-attribute name="breadcrumb"  	value="" />
		<put-attribute name="body-content"  value="" />
		<put-attribute name="footer" 		value="/WEB-INF/webtiles/common/footer.jsp" />
	</definition>

Struts2 Config: 
<struts>
	<package name="cmn-queue" namespace="/queue" extends="cmn-default">
		<action name="displayQueue_*" method="{1}"  
			class="com.ahp.cmn.action.queue.DisplayCMNAction">
			<param name="close">false</param>						
			<result type="tiles">layout.cmnQueue</result>
			<result name="input">/</result>
        </action>
	</package>
</struts>

Any idea why this doesn't work?  I've read that there are compatibility issues between S2
and T2.  It works fine as long as I don't try to jar up configurations and use the deprecated
class org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG instead of org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG

Tiles and Struts versions as follows:

<dependency org="org.apache.struts" name="struts2-core" rev="2.1.8"/>
<dependency org="org.apache.struts" name="struts2-tiles-plugin" rev="2.1.8"/>
This pulls in tiles 2.0.6

Regards,
Brian Stewart 

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