Return-Path: Delivered-To: apmail-jakarta-velocity-user-archive@www.apache.org Received: (qmail 76923 invoked from network); 7 Sep 2004 23:46:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Sep 2004 23:46:30 -0000 Received: (qmail 3305 invoked by uid 500); 7 Sep 2004 23:46:25 -0000 Delivered-To: apmail-jakarta-velocity-user-archive@jakarta.apache.org Received: (qmail 3267 invoked by uid 500); 7 Sep 2004 23:46:24 -0000 Mailing-List: contact velocity-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Velocity Users List" Reply-To: "Velocity Users List" Delivered-To: mailing list velocity-user@jakarta.apache.org Received: (qmail 3253 invoked by uid 99); 7 Sep 2004 23:46:24 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [171.68.10.87] (HELO sj-iport-5.cisco.com) (171.68.10.87) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 07 Sep 2004 16:46:23 -0700 Received: from sj-core-3.cisco.com (171.68.223.137) by sj-iport-5.cisco.com with ESMTP; 07 Sep 2004 16:46:36 -0700 X-BrightmailFiltered: true Received: from malone.cisco.com (malone.cisco.com [171.70.157.157]) by sj-core-3.cisco.com (8.12.10/8.12.6) with ESMTP id i87Nj9eP014758 for ; Tue, 7 Sep 2004 16:46:20 -0700 (PDT) Received: from tcolsonwxp01 ([10.25.24.8] (may be forged)) by malone.cisco.com (8.8.6 (PHNE_14041)/CISCO.SERVER.1.2) with ESMTP id QAA21728 for ; Tue, 7 Sep 2004 16:41:51 -0700 (PDT) Message-Id: <200409072341.QAA21728@malone.cisco.com> From: "Tim Colson" To: "'Velocity Users List'" Subject: Using both Jar and Webapp resource paths Date: Tue, 7 Sep 2004 16:41:51 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <006f01c485ff$d3f15620$6b7ba8c0@zeus.esha.com> Thread-Index: AcSGACYRIoD+upWbR+iBFgYrHgfpQAPDd0sQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Nathan said: > if there's ... no resource loader specified in the > velocity.properties file, then the WebappLoader is used. > otherwise, if resource loader(s) > is/are specified in whatever properties file the user tells > the VVS to use, the VVS will use that/those resource loader(s). I'm trying to setup a dev environment where include paths can stay the same for local files, as well as later when I bundle up the 'common' layout/macros into a JAR. That jar will be shared among other projects. (Try THAT, JSP! ) I have dual loaders working for VelocityViewServlet: #--------------------------------------------------------------------------- - # RESOURCE loaders #--------------------------------------------------------------------------- - resource.loader = class, webapp # # ClasspathResourceLoader class.resource.loader.description = Velocity Classpath Resource Loader class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader # WebappResourceLoader webapp.resource.loader.description = Velocity Webapp Resource Loader webapp.resource.loader.class=org.apache.velocity.tools.view.servlet.WebappLo ader To make paths work in either case, I added template directories into the classpath. Works great to resolve "common/footer.vm" in WEB-INF/templates/vm/common/footer.vm or inside a bundled common-ui.jar. I looked at the WebappLoader and it seems the same functionality can be setup in the config with webapp.resource.loader.path. Spiffy. In fact, it works so well, I'm kind of spoiled now. So just wanted to say my hats off to Geir/Nathan/Gabe/Marino and everyone else for continuing to surprise me with code that Just Works. :-) Cheers, Timo --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-user-help@jakarta.apache.org