Return-Path: Delivered-To: apmail-jakarta-velocity-user-archive@www.apache.org Received: (qmail 30548 invoked from network); 2 Apr 2005 07:20:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Apr 2005 07:20:15 -0000 Received: (qmail 45434 invoked by uid 500); 2 Apr 2005 07:20:09 -0000 Delivered-To: apmail-jakarta-velocity-user-archive@jakarta.apache.org Received: (qmail 45411 invoked by uid 500); 2 Apr 2005 07:20:08 -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 45398 invoked by uid 99); 2 Apr 2005 07:20:08 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from 209-128-104-244.bayarea.net (HELO secf.com) (209.128.104.244) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 01 Apr 2005 23:20:07 -0800 Received: from UKUMAR ([220.227.32.11]) by secf.com (mail.secf.com [209.128.104.242]) (MDaemon.PRO.v7.2.2.R) with ESMTP id md50000568615.msg for ; Fri, 01 Apr 2005 23:20:13 -0800 From: "Uday Kumar" To: "Velocity Users List" , "Shinobu Kawai" Subject: RE: Loading templates from classpath Date: Sat, 2 Apr 2005 12:49:29 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal In-Reply-To: <376e3b1405040114067ac58fd9@mail.gmail.com> X-Spam-Processed: mail.secf.com, Fri, 01 Apr 2005 23:20:13 -0800 (not processed: message from valid local sender) X-MDRemoteIP: 220.227.32.11 X-Return-Path: uday.kumar@secf.com X-MDaemon-Deliver-To: velocity-user@jakarta.apache.org X-MDAV-Processed: mail.secf.com, Fri, 01 Apr 2005 23:20:16 -0800 X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, Can u pls help me regarding velocity macros . how to create a macro library and also i would like to use a macro to embedd a tree structure in web page Regards, uday -----Original Message----- From: Shinobu Kawai [mailto:shinobu.kawai@gmail.com] Sent: Saturday, April 02, 2005 3:37 AM To: Velocity Users List Subject: Re: Loading templates from classpath Hi seba, > You read my mind. 8^) Here's the catch: put this in the servlet. > > protected Properties loadConfiguration( final ServletConfig config ) throws FileNotFoundException, IOException { > Properties p = super.loadConfiguration( config ); > p.setProperty( "resource.loader", "class" ); > p.setProperty( "class.resource.loader.class", ClasspathResourceLoader.class.getName() ); > return p; > } Thanks for sharing your solution with us! Maybe someday it'll get into the FAQ. http://wiki.apache.org/jakarta-velocity/VelocityFAQ ## Anyone can update the wiki, BTW. B) > What was completely confusing me is that Velocity defines a number of > final static constant strings for properties, but apparently not for > *all* properties. "class.resource.loader.class" is not in, or I couldn't > find it. Anyway... FYI, there's one for "resource.loader". :) Best regards, -- Shinobu -- Shinobu Kawai --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: velocity-user-help@jakarta.apache.org