Purpose
Design an "add-on" to a web project.
Web Project
I have a project packaged as WAR which uses Spring MVC 4.1.6 and Apache Tiles 3.0.5 as the UI framework. This a sample of the application-context:
<bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer" id="tilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/foo/bar/layouts.xml</value>
<value>classpath:/META-INF/ext/**/views.xml</value><!-- For add-ons -->
</list>
</property>
</bean>
JAR
I have another JAR, which is the "add-on". This jar will need to contain some jsp files. The general idea is, if I remove this jar from /WEB-INF/lib directory, all related features will be removed when I restart the web server. Likewise, all related features will be available when I put the jar into the lib directory. Sample tiles definition (views.xml):
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN" "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<definition extends="main" name="space">
<!-- This does not work -->
<put-attribute name="body" value="classpath:/META-INF/resources/index.jspx" />
</definition>
</tiles-definitions>
1. Can the jsp files that resides in the JAR file be defined in the tiles definition?
2. Can this be achieved with/without using web-fragment?