You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tiles.apache.org by Brian Stewart <Br...@ahom.com> on 2009/10/23 16:02:57 UTC

RE: Tiles Definition Files From a Jar

I tried using the wildcard instructions.  The project compiles and the server starts, so I assume that the definitions are available.  However, Struts2 doesn't seem to see them.  This is the case whether I use "classpath:" or not.  When I run in debug mode, I see that the action class is returning "SUCCESS", but then throwing an exception in the interceptor when trying to find its next destination (which is defined as a tiles destination.)

Here is my configuration... 
	<!--====================================-->
	<!-- Context Parameters                 -->
	<!--====================================-->
	<context-param>
	    <param-name>org.apache.tiles.context.AbstractTilesApplicationContextFactory</param-name>
	    <param-value>
	      org.apache.tiles.servlet.context.wildcard.WildcardServletTilesApplicationContextFactory
	    </param-value>
	</context-param>
	<context-param>
		<param-name>org.apache.tiles.definition.DefinitionsFactory.DEFINITIONS_CONFIG</param-name>
		<param-value>
			/WEB-INF/classes/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>

	<!--====================================-->
	<!-- Filters/Mappings                   -->
	<!--====================================-->
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>*</url-pattern>
    </filter-mapping>
    
	<!--====================================-->
	<!-- Listeners                          -->
	<!--====================================-->
    <listener>
		<listener-class>org.apache.tiles.web.startup.TilesListener</listener-class>
	</listener>

	<!--===================================-->
	<!-- DEPENDENCIES FROM IVY.XML         -->
	<!--===================================-->

		<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"/>
		
		<dependency org="org.springframework" name="spring-web" rev="2.5.6.SEC01">
			<exclude org="javax.jms" name="jms" ext="jar"/>
			<exclude org="com.sun.jdmk" name="jmxtools" ext="jar"/>
			<exclude org="com.sun.jmx" name="jmxri" ext="jar"/>
			<exclude org="javax.faces" name="jsf-api" ext="jar"/>
		</dependency>
		
		<dependency org="jstl" name="jstl" rev="1.1.2"/>


As far as the war goes, there is another webapp that serves up common components which I could give other apps access to.  I was thinking maybe I could access the configuration as a uri from that webapp.

I'm going to try using Ant to pull common components into the application from a template project (pre-deployment) and then have tiles/struts reference them locally.  That should work.

Regards,
Brian

-----Original Message-----
From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com] 
Sent: Friday, October 23, 2009 1:35 AM
To: users@tiles.apache.org
Subject: Re: Tiles Definition Files From a Jar or War

2009/10/22 Brian Stewart <Br...@ahom.com>:
> What is the proper way to load a Tiles2 definitions file from a jar file or another war file on the classpath?

The easiest way to load a definition file from the classpath is using this:
http://tiles.apache.org/2.1/framework/tutorial/wildcard-configuration.html

However I don't understand by "loading definitions from another war
file on the classpath". Do you want to reference an external file?

Antonio<HTML><BODY><P><hr size=1></P>
<P><STRONG>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.</STRONG></P></BODY></HTML>