I have 3 maven modules. In one module MAIN - I have dependency from 2 another (MODULE1 and MODULE2). All modules based on spring mvc. So, in all modules I use tiles as template constructor. In MAIN module in mvc-dipatcher-servlet.xml i try to configurate it
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles2.TilesView
</value>
</property>
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/module-one-tiles.xml</value>
<value>/WEB-INF/module-main-tiles.xml</value>
</list>
</property>
</bean>
But it gives me an error, that it cannot find module-one-tiles.xml
file. I also tried to use classpath*
, the same result. Is it possible to add tiles.xml
files from another maven modules?
if your module jar contains /WEB-INF/module-one-tiles.xml
at this location and your module jar is in classpath of your MAIN module then
<value>classpath:/WEB-INF/module-one-tiles.xml</value>
would work