Less Configuration - Part III

I forgot to post the code for the ISpecificationResolverDelegate described in Part I and Part II , download it here.

After reviewing the code I got into the Tapestry component resolution classes and added the feature to the built-in page and component resolution. Now I don't even need the extension declaration in my application specification, less configuration.

The recursive directory traversal only comes into play if the WEB-INF IResourceLocation URL is a file: URL. It worked fine when I deployed a test app into Jetty and Resin, but not in Tomcat. Tomcat appears to maintain jndi: URLS, even if the Tapestry application is deployed as an exploded WAR. If there's a Tomcat guru reading this who can shed some light on Tomcat resource URLS so I can handle this without custom code, I'd appreciate it.

If you want to try this yourself download a patched tapestry-3.0.jar or apply a patch to the Tapestry 3.0 source code.

With Tapestry patched this way my application specification has dropped down to:


<application name="tapestry-users" engine-class="com.mjhenderson.users.tapestry.engine.UsersEngine" > <description><![CDATA[ A Tapestry Test Application ]]></description> <property name="org.apache.tapestry.disable-caching" value="true"/> <property name="org.apache.tapestry.visit-class" value="com.mjhenderson.users.tapestry.Visit"/> <service name="users.membership" class="com.mjhenderson.users.tapestry.engine.MembershipEngineService"/> <library id="springinspector" specification-path="/com/mjhenderson/tapestry/springinspector/springinspector.library"/> <library id="contrib" specification-path="/org/apache/tapestry/contrib/Contrib.library"/> </application>

Not much at all.