|
From: <dar...@hs...> - 2003-08-06 12:07:38
|
I know you guys are busy with imminent package renames and releases, so apologies in advance if this is the wrong time to be sending patches! Attached is a class that extends com.interface21.web.servlet.view.velocity.VelocityConfigurer in order to permit velocity templates to be portably loaded from within the WAR without having them in the source tree (and thereby the classpath). The overridden initApplicationContext() method prefixes the template path root with the real path to the WAR root. The javadoc for the class should make it clear. In order for this to work, the superclass (VelocityConfigurer) needs to have the location field promoted from private to protected. The only alternative would be to override the setLocation() method in WarVelocityConfigurer too which is the wrong way to do it I think. The very trivial patch file for this change is also attached. The code relies on the web container using exploded WAR files. Tomcat and WebSphere both do by default, but I'm not sure that WebLogic does. Both changes are based on the 0.9 release (I've no access to CVS at present to see if updates are available to this part of Spring) and have been tested successfully in the following locations: WebSphere 4.0.4 on Windows WebSphere 5.0 on Windows Tomcat 4.1.18 on Windows Tomcat 4.1.24 on Linux Regards, Darren Davison CIBM Intranet Team int> 799 19431 ext> +44 (0)20 7991 9431 (See attached file: WarVelocityConfigurer.java)(See attached file: VelocityConfigurer.patch) _____________________________________________________ This transmission has been issued by a member of the HSBC Group "HSBC" for the information of the addressee only and should not be reproduced and / or distributed to any other person. Each page attached hereto must be read in conjunction with any disclaimer which forms part of it. Unless otherwise stated, this transmission is neither an offer nor the solicitation of an offer to sell or purchase any investment. Its contents are based on information obtained from sources believed to be reliable but HSBC makes no representation and accepts no responsibility or liability as to its completeness or accuracy. |