From velocity-user-returnjasmine05@example.org Wed Mar 02 13:58:21 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 53389 invoked from network); 2 Mar 2005 13:58:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 13:58:21 -0000 Received: (qmail 18699 invoked by uid 500); 2 Mar 2005 13:58:19 -0000 Delivered-To: jasmine05@example.org Received: (qmail 18675 invoked by uid 500); 2 Mar 2005 13:58:19 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 18661 invoked by uid 99); 2 Mar 2005 13:58:18 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp106.mail.sc5.yahoo.com (HELO smtp106.mail.sc5.yahoo.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with SMTP; Wed, 02 Mar 2005 05:58:16 -0800 Received: from unknown (HELO ?83.161.120.155?) (jasmine05@example.org with plain) by smtp106.mail.sc5.yahoo.com with SMTP; 2 Mar 2005 13:58:14 -0000 Message-ID: <jasmine05@example.org> Date: Wed, 02 Mar 2005 08:58:35 -0500 From: Matthew Van Horn <jasmine05@example.org> User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jasmine05@example.org Subject: best practice question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I use a Constants class in my application to hold a bunch of strings used for things like request attribute keys etc. In my templates, I would also like to eliminate the hard-coded strings, and I thought I could do that by using the Constants class as a tool. <tool> <key>const</key> <scope>application</scope> <class>com.foo.util.Constants</class> </tool> public class Constants { public static final String PROPERTY = "my.property"; //etc.. //I even tried this: public static String getPROPERTY() { return PROPERTY; } } in my template $const.PROPERTY $const.getPROPERTY() both turn up as invalid references. but $const.toString() works, so an object must be there. Is this something to do with static methods? I added a non-static method to test, but that didn't work either. Do I need to implement the ViewTool interface? What should I do in init() then? According to the docs available I thought this was possible, but now I am stumped. Hope I won't feel too stupid upon figuring this out. Thanks for any help, Matt Van Horn --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 16:12:38 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 59200 invoked from network); 2 Mar 2005 16:12:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 16:12:38 -0000 Received: (qmail 30561 invoked by uid 500); 2 Mar 2005 16:12:34 -0000 Delivered-To: jasmine05@example.org Received: (qmail 30526 invoked by uid 500); 2 Mar 2005 16:12:33 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 30509 invoked by uid 99); 2 Mar 2005 16:12:33 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 08:12:33 -0800 Received: by wproxy.gmail.com with SMTP id 58so265329wri for <jasmine05@example.org>; Wed, 02 Mar 2005 08:12:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=WU7sZp4j2VQpmvsUz3qf4UWsQfzwe+ZDsBfxV7tYJfcYjO1JiiQia9k9P1CtoizbYMJOkl2oICkunXnRH+DCdX37+2+azUDdE8NmFuGN7NGAFu9Qaon8aBave4b4gO36O1XboviBDm7JA+7gHEGswsqn3CHlfFd1FPF2YrGKg5Q= Received: by 83.161.120.155 with SMTP id k10mr71420wra; Wed, 02 Mar 2005 08:12:30 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2005 08:12:30 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Wed, 2 Mar 2005 08:12:30 -0800 From: Nathan Bubna <jasmine05@example.org> Reply-To: Nathan Bubna <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: best practice question In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N that's very strange. what you're doing looks fine to me and definitely should work. and no, it shouldn't make a difference whether the methods are static or not. they just need to be public methods in public classes. so, the first thing i suggest double-checking is that the Constants class is declared public. if it's not, it would explain why toString() works, but your methods don't (toString() is in Object, which is declared public). if that's not the problem, then would you send your Constants class itself for us to try this out? if you're not comfortable or allowed to show it to the public list, you could just send it to me, and i'll try it out. On Wed, 02 Mar 2005 08:58:35 -0500, Matthew Van Horn <jasmine05@example.org> wrote: > I use a Constants class in my application to hold a bunch of strings > used for things like request attribute keys etc. In my templates, I > would also like to eliminate the hard-coded strings, and I thought I > could do that by using the Constants class as a tool. > > <tool> > <key>const</key> > <scope>application</scope> > <class>com.foo.util.Constants</class> > </tool> > > public class Constants { > > public static final String PROPERTY = "my.property"; > //etc.. > > //I even tried this: > public static String getPROPERTY() { > return PROPERTY; > } > } > > in my template > $const.PROPERTY > $const.getPROPERTY() > both turn up as invalid references. > > but $const.toString() works, so an object must be there. > > Is this something to do with static methods? I added a non-static method > to test, but that didn't work either. > > Do I need to implement the ViewTool interface? What should I do in > init() then? > > According to the docs available I thought this was possible, but now I > am stumped. Hope I won't feel too stupid upon figuring this out. > > Thanks for any help, > Matt Van Horn > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jasmine05@example.org > For additional commands, e-mail: jasmine05@example.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 18:30:10 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 34979 invoked from network); 2 Mar 2005 18:30:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 18:30:10 -0000 Received: (qmail 70584 invoked by uid 500); 2 Mar 2005 18:30:06 -0000 Delivered-To: jasmine05@example.org Received: (qmail 70570 invoked by uid 500); 2 Mar 2005 18:30:05 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 60278 invoked by uid 99); 2 Mar 2005 18:23:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) From: "e v a n l e o n a r d" <jasmine05@example.org> To: <jasmine05@example.org> Subject: "For each" on an object? Date: Wed, 2 Mar 2005 13:23:31 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcUfVOu0TpTRe4xBTGe8Q1V26JdlOQ== X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, I am trying to create a macro that can either take a single string parameter, or an array of strings. The code looks something like this: #macro(get $things) #foreach($thing in $things) ## do something... #end #end What I would like to happen is that if $things is only a single object and not a collection, for it to be assigned to $thing, and then the inner code run only once. This way foreach loops would be useful over more variable input. Has there been any thought about this already? Or, how would others solve this problem? Sincerely, Evan Leonard --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 18:42:21 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 42051 invoked from network); 2 Mar 2005 18:42:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 18:42:21 -0000 Received: (qmail 11988 invoked by uid 500); 2 Mar 2005 18:42:18 -0000 Delivered-To: jasmine05@example.org Received: (qmail 11959 invoked by uid 500); 2 Mar 2005 18:42:18 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 11946 invoked by uid 99); 2 Mar 2005 18:42:18 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from keiko.intelligenthosting.net (HELO keiko.intelligenthosting.net) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 10:42:17 -0800 Received: (qmail 11588 invoked from network); 2 Mar 2005 18:42:15 -0000 Received: from unknown (HELO Manta) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Mar 2005 18:42:15 -0000 From: "e v a n l e o n a r d" <jasmine05@example.org> To: <jasmine05@example.org> Subject: "For each" on an object? Date: Wed, 2 Mar 2005 13:42:13 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcUfVOu0TpTRe4xBTGe8Q1V26JdlOQAAowjw X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, I am trying to create a macro that can either take a single string parameter, or an array of strings. The code looks something like this: #macro(get $things) #foreach($thing in $things) ## do something... #end #end What I would like to happen is that if $things is only a single object and not a collection, for it to be assigned to $thing, and then the inner code run only once. This way foreach loops would be useful over more variable input. Has there been any thought about this already? Or, how would others solve this problem? Sincerely, Evan Leonard --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 18:45:30 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 43358 invoked from network); 2 Mar 2005 18:45:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 18:45:30 -0000 Received: (qmail 14949 invoked by uid 500); 2 Mar 2005 18:45:27 -0000 Delivered-To: jasmine05@example.org Received: (qmail 14930 invoked by uid 500); 2 Mar 2005 18:45:27 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 14917 invoked by uid 99); 2 Mar 2005 18:45:27 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from smtp2.housing.ufl.edu (HELO smtp2.housing.ufl.edu) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 10:45:25 -0800 Received: (qmail 1679 invoked by uid 98); 2 Mar 2005 13:45:21 -0500 Received: from 83.161.120.155 by smtp2.housing.ufl.edu (envelope-from <jasmine05@example.org>, uid 1002) with qmail-scanner-1.25 (clamdscan: 0.83/705. spamassassin: 3.0.2. Clear:RC:1(83.161.120.155):. Processed in 0.099644 secs); 02 Mar 2005 18:45:21 -0000 X-Qmail-Scanner-Mail-From: jasmine05@example.org via smtp2.housing.ufl.edu X-Qmail-Scanner: 1.25 (Clear:RC:1(83.161.120.155):. Processed in 0.099644 secs) Received: from bragi.housing.ufl.edu (83.161.120.155) by smtp2.housing.ufl.edu with RC4-MD5 encrypted SMTP; 2 Mar 2005 13:45:21 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.0.6556.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: "For each" on an object? Date: Wed, 2 Mar 2005 13:45:21 -0500 Message-ID: <jasmine05@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: "For each" on an object? Thread-Index: AcUfVOu0TpTRe4xBTGe8Q1V26JdlOQAAowjwAAAedkA= From: "Sayed Hashimi" <jasmine05@example.org> To: "Velocity Users List" <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, Why don't you just assign $things to an array with 1 element instead of = just to the string object? If you do this then you definitely shouldn't have problems. Hope this helps, Sayed Ibrahim Hashimi www.cise.ufl.edu/~sih -----Original Message----- From: e v a n l e o n a r d [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 1:42 PM To: jasmine05@example.org Subject: "For each" on an object? Hello, I am trying to create a macro that can either take a single string parameter, or an array of strings. The code looks something like this: #macro(get $things) #foreach($thing in $things) ## do something... #end #end What I would like to happen is that if $things is only a single object = and not a collection, for it to be assigned to $thing, and then the inner = code run only once. This way foreach loops would be useful over more variable input. Has there been any thought about this already? Or, how would others = solve this problem? Sincerely, Evan Leonard --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 19:14:25 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 55070 invoked from network); 2 Mar 2005 19:14:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 19:14:25 -0000 Received: (qmail 64715 invoked by uid 500); 2 Mar 2005 19:14:22 -0000 Delivered-To: jasmine05@example.org Received: (qmail 64688 invoked by uid 500); 2 Mar 2005 19:14:21 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 64675 invoked by uid 99); 2 Mar 2005 19:14:21 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from keiko.intelligenthosting.net (HELO keiko.intelligenthosting.net) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 11:14:20 -0800 Received: (qmail 19860 invoked from network); 2 Mar 2005 19:14:18 -0000 Received: from unknown (HELO Manta) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Mar 2005 19:14:18 -0000 From: "e v a n l e o n a r d" <jasmine05@example.org> To: "'Velocity Users List'" <jasmine05@example.org> Subject: RE: "For each" on an object? Date: Wed, 2 Mar 2005 14:14:15 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <jasmine05@example.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcUfVOu0TpTRe4xBTGe8Q1V26JdlOQAAowjwAAAedkAAAPe+IA== X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I guess its just a usability thing. To be able to pass a single string would avoid careless errors, that's all. I may settle for what you suggest though. -Evan -----Original Message----- From: Sayed Hashimi [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 1:45 PM To: Velocity Users List Subject: RE: "For each" on an object? Hi, Why don't you just assign $things to an array with 1 element instead of just to the string object? If you do this then you definitely shouldn't have problems. Hope this helps, Sayed Ibrahim Hashimi www.cise.ufl.edu/~sih -----Original Message----- From: e v a n l e o n a r d [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 1:42 PM To: jasmine05@example.org Subject: "For each" on an object? Hello, I am trying to create a macro that can either take a single string parameter, or an array of strings. The code looks something like this: #macro(get $things) #foreach($thing in $things) ## do something... #end #end What I would like to happen is that if $things is only a single object and not a collection, for it to be assigned to $thing, and then the inner code run only once. This way foreach loops would be useful over more variable input. Has there been any thought about this already? Or, how would others solve this problem? Sincerely, Evan Leonard --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 19:21:06 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 59697 invoked from network); 2 Mar 2005 19:21:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 19:21:05 -0000 Received: (qmail 82240 invoked by uid 500); 2 Mar 2005 19:21:02 -0000 Delivered-To: jasmine05@example.org Received: (qmail 82212 invoked by uid 500); 2 Mar 2005 19:21:02 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 82190 invoked by uid 99); 2 Mar 2005 19:21:01 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from smtp2.housing.ufl.edu (HELO smtp2.housing.ufl.edu) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 11:21:00 -0800 Received: (qmail 4005 invoked by uid 98); 2 Mar 2005 14:20:57 -0500 Received: from 83.161.120.155 by smtp2.housing.ufl.edu (envelope-from <jasmine05@example.org>, uid 1002) with qmail-scanner-1.25 (clamdscan: 0.83/705. spamassassin: 3.0.2. Clear:RC:1(83.161.120.155):. Processed in 0.11127 secs); 02 Mar 2005 19:20:57 -0000 X-Qmail-Scanner-Mail-From: jasmine05@example.org via smtp2.housing.ufl.edu X-Qmail-Scanner: 1.25 (Clear:RC:1(83.161.120.155):. Processed in 0.11127 secs) Received: from bragi.housing.ufl.edu (83.161.120.155) by smtp2.housing.ufl.edu with RC4-MD5 encrypted SMTP; 2 Mar 2005 14:20:57 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.0.6556.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: "For each" on an object? Date: Wed, 2 Mar 2005 14:20:57 -0500 Message-ID: <jasmine05@example.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: "For each" on an object? Thread-Index: AcUfVOu0TpTRe4xBTGe8Q1V26JdlOQAAowjwAAAedkAAAPe+IAAATWhw From: "Sayed Hashimi" <jasmine05@example.org> To: "Velocity Users List" <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N How bout this: #macro(get $things) #set($didRun =3D "0" ) #foreach($thing in $things) ## do something... =09 #set($didRun =3D "1" ) #end #this will test if the above loop was executed and if not #but the variable is not null then it must be single object. #if( $didRun =3D=3D "0" && $things ) #do whatever you would do above #end #end I didn't test that so I don't know if it works. Hope this helps, Sayed Ibrahim Hashimi www.cise.ufl.edu/~sih -----Original Message----- From: e v a n l e o n a r d [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 2:14 PM To: 'Velocity Users List' Subject: RE: "For each" on an object? I guess its just a usability thing. To be able to pass a single string would avoid careless errors, that's all. I may settle for what you = suggest though. -Evan =20 -----Original Message----- From: Sayed Hashimi [mailto:jasmine05@example.org]=20 Sent: Wednesday, March 02, 2005 1:45 PM To: Velocity Users List Subject: RE: "For each" on an object? Hi, Why don't you just assign $things to an array with 1 element instead of = just to the string object? If you do this then you definitely shouldn't have problems. Hope this helps, Sayed Ibrahim Hashimi www.cise.ufl.edu/~sih -----Original Message----- From: e v a n l e o n a r d [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 1:42 PM To: jasmine05@example.org Subject: "For each" on an object? Hello, I am trying to create a macro that can either take a single string parameter, or an array of strings. The code looks something like this: #macro(get $things) #foreach($thing in $things) ## do something... #end #end What I would like to happen is that if $things is only a single object = and not a collection, for it to be assigned to $thing, and then the inner = code run only once. This way foreach loops would be useful over more variable input. Has there been any thought about this already? Or, how would others = solve this problem? Sincerely, Evan Leonard --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 20:29:36 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 4018 invoked from network); 2 Mar 2005 20:29:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 20:29:36 -0000 Received: (qmail 97888 invoked by uid 500); 2 Mar 2005 20:29:33 -0000 Delivered-To: jasmine05@example.org Received: (qmail 97858 invoked by uid 500); 2 Mar 2005 20:29:32 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 97845 invoked by uid 99); 2 Mar 2005 20:29:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from n33.kp.t-systems-sfr.com (HELO n33.kp.t-systems-sfr.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 12:29:31 -0800 Received: from n81.sp.op.dlr.de (n81g.sp.op.dlr.de [83.161.120.155]) by n33.kp.t-systems-sfr.com (8.11.7-20030917/8.11.7) with ESMTP id j22KTFI100518 for <jasmine05@example.org>; Wed, 2 Mar 2005 21:29:15 +0100 Received: from [83.161.120.155] (manticore.af.op.dlr.de [83.161.120.155]) by n81.sp.op.dlr.de (AIX5.1/8.11.6p2/8.11.0) with ESMTP id j22KTAS691726 for <jasmine05@example.org>; Wed, 2 Mar 2005 21:29:11 +0100 Message-ID: <jasmine05@example.org> Date: Wed, 02 Mar 2005 21:29:10 +0100 From: Christoph Reck <jasmine05@example.org> User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20040621 X-Accept-Language: en, de MIME-Version: 1.0 To: Velocity Users List <jasmine05@example.org> Subject: Re: best practice question References: <jasmine05@example.org> In-Reply-To: <jasmine05@example.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I remember having problems with the introspector when accessing static methods of a class itself. But somehow I cannot believe that it is causing problems when the class was instantiated. If you tested removing the "static" from the getter, and it still does not work: public String getPROPERTY() { return PROPERTY; } Then my guess goes to the velocity treatment of getters, where the first letter is uppercased (I don't know if the rest is touched...) but anyhow, if you tested $const.getPROPERTY() and it also did not work, then something is really strange... You might test the following workaround, by adding this to the class: public String get(String key) { return "PROPERTY".equals(key) ? PROPERTY /* "PROPERTY2".equals(key) ? PROPERTY2 */ /* more if cascades here... */ : ""; } Somewhere in the velocity contributions there is a FieldIntrospector, that should help you to avoid the getters totaly. Try searching the mailing list archives or browsing the SVN repository for it. Also there was something on setting up the Ueberspector allowing a chain of user defined introspectors. Cheers, Christoph Matthew Van Horn wrote: > I use a Constants class in my application to hold a bunch of strings > used for things like request attribute keys etc. In my templates, I > would also like to eliminate the hard-coded strings, and I thought I > could do that by using the Constants class as a tool. > > <tool> > <key>const</key> > <scope>application</scope> > <class>com.foo.util.Constants</class> > </tool> > > public class Constants { > > public static final String PROPERTY = "my.property"; > //etc.. > > //I even tried this: > public static String getPROPERTY() { > return PROPERTY; > } > } > > in my template > $const.PROPERTY > $const.getPROPERTY() > both turn up as invalid references. > > but $const.toString() works, so an object must be there. > > Is this something to do with static methods? I added a non-static method > to test, but that didn't work either. > > Do I need to implement the ViewTool interface? What should I do in > init() then? > > According to the docs available I thought this was possible, but now I > am stumped. Hope I won't feel too stupid upon figuring this out. > > Thanks for any help, > Matt Van Horn --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Wed Mar 02 20:30:57 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 4404 invoked from network); 2 Mar 2005 20:30:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 2 Mar 2005 20:30:57 -0000 Received: (qmail 99120 invoked by uid 500); 2 Mar 2005 20:30:55 -0000 Delivered-To: jasmine05@example.org Received: (qmail 99087 invoked by uid 500); 2 Mar 2005 20:30:54 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 99068 invoked by uid 99); 2 Mar 2005 20:30:54 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from keiko.intelligenthosting.net (HELO keiko.intelligenthosting.net) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 12:30:53 -0800 Received: (qmail 30744 invoked from network); 2 Mar 2005 20:30:51 -0000 Received: from unknown (HELO Manta) (83.161.120.155) by 83.161.120.155 with SMTP; 2 Mar 2005 20:30:51 -0000 From: "e v a n l e o n a r d" <jasmine05@example.org> To: "'Velocity Users List'" <jasmine05@example.org> Subject: RE: "For each" on an object? Date: Wed, 2 Mar 2005 15:30:48 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <jasmine05@example.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcUfVOu0TpTRe4xBTGe8Q1V26JdlOQAAowjwAAAedkAAAPe+IAAATWhwAAJjSAA= X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N That's might work. Not as clean as I might like, but it'll be tucked away in the macro anyway. Thank you for the idea Sayed, Evan -----Original Message----- From: Sayed Hashimi [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 2:21 PM To: Velocity Users List Subject: RE: "For each" on an object? How bout this: #macro(get $things) #set($didRun = "0" ) #foreach($thing in $things) ## do something... #set($didRun = "1" ) #end #this will test if the above loop was executed and if not #but the variable is not null then it must be single object. #if( $didRun == "0" && $things ) #do whatever you would do above #end #end I didn't test that so I don't know if it works. Hope this helps, Sayed Ibrahim Hashimi www.cise.ufl.edu/~sih -----Original Message----- From: e v a n l e o n a r d [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 2:14 PM To: 'Velocity Users List' Subject: RE: "For each" on an object? I guess its just a usability thing. To be able to pass a single string would avoid careless errors, that's all. I may settle for what you suggest though. -Evan -----Original Message----- From: Sayed Hashimi [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 1:45 PM To: Velocity Users List Subject: RE: "For each" on an object? Hi, Why don't you just assign $things to an array with 1 element instead of just to the string object? If you do this then you definitely shouldn't have problems. Hope this helps, Sayed Ibrahim Hashimi www.cise.ufl.edu/~sih -----Original Message----- From: e v a n l e o n a r d [mailto:jasmine05@example.org] Sent: Wednesday, March 02, 2005 1:42 PM To: jasmine05@example.org Subject: "For each" on an object? Hello, I am trying to create a macro that can either take a single string parameter, or an array of strings. The code looks something like this: #macro(get $things) #foreach($thing in $things) ## do something... #end #end What I would like to happen is that if $things is only a single object and not a collection, for it to be assigned to $thing, and then the inner code run only once. This way foreach loops would be useful over more variable input. Has there been any thought about this already? Or, how would others solve this problem? Sincerely, Evan Leonard --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 04:55:14 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 16607 invoked from network); 3 Mar 2005 04:55:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 04:55:14 -0000 Received: (qmail 83664 invoked by uid 500); 3 Mar 2005 04:55:11 -0000 Delivered-To: jasmine05@example.org Received: (qmail 83639 invoked by uid 500); 3 Mar 2005 04:55:11 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 83625 invoked by uid 99); 3 Mar 2005 04:55:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mailpipe.athena.thinkhost.com (HELO athena.thinkhost.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 20:55:09 -0800 Received: from stan (itpremium.omsk.ru [83.161.120.155]) by athena.thinkhost.com (8.13.2/8.13.2) with ESMTP id j234t4x7021605 for <jasmine05@example.org>; Wed, 2 Mar 2005 23:55:06 -0500 (EST) (envelope-from jasmine05@example.org) Date: Thu, 3 Mar 2005 10:54:26 +0600 From: Stan Devyatovsky <jasmine05@example.org> X-Mailer: The Bat! (v1.61) Reply-To: Stan Devyatovsky <jasmine05@example.org> X-Priority: 3 (Normal) Message-ID: <jasmine05@example.org> To: "Velocity Users List" <jasmine05@example.org> Subject: JarResourceLoader In-Reply-To: <jasmine05@example.org> References: <jasmine05@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello, If I use JarResourceLoader, will any uploads of new .jar with templates be notified by it? I.e., I first uploaded templates.jar, started webapp, then reuploaded modified templates.jar - will my modifications take place without restarting webapplication? Thank you in advance. -- Best regards, Stan mailto:jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 06:34:24 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 66097 invoked from network); 3 Mar 2005 06:34:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 06:34:24 -0000 Received: (qmail 78376 invoked by uid 500); 3 Mar 2005 06:34:22 -0000 Delivered-To: jasmine05@example.org Received: (qmail 78355 invoked by uid 500); 3 Mar 2005 06:34:22 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 78342 invoked by uid 99); 3 Mar 2005 06:34:22 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 22:34:21 -0800 Received: by rproxy.gmail.com with SMTP id a41so305156rng for <jasmine05@example.org>; Wed, 02 Mar 2005 22:34:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=VmTO0aj/DoG0rC+2hRGdTd9SrwQlW7+l0PKSJrNENMFKnzfUfirNiW3VU5//2Ebc1AwJW3N6CWOcia6n8XPVvxNzILIrY5bJ0WULOjwqF7ZQz/ZtuAYbzTmA9uABhKOh7lRtpp8yQvzpaeIRGXc+sNg3GM8xNr531PAE54HI01M= Received: by 83.161.120.155 with SMTP id h6mr56288rna; Wed, 02 Mar 2005 22:33:47 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2005 22:33:47 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Wed, 2 Mar 2005 22:33:47 -0800 From: Shinobu Kawai <jasmine05@example.org> Reply-To: Shinobu Kawai <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: Creating objects in template using "new" keyword In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Ravikanth, > I would like to create a object reference in template using "new" > keyword like what we do in java > > String obj = new String() > > I need to put RenderTool instance in context and use it to fix some > problem. I know that i can put it to context from the java code where > the template is being called or using toolbox.xml But as my > application is standalone and in production and i don't want to change > the java code to fix the issue, i want to handle it in template. If you really, really, really want to do it, check out the deprecated ToolLoader. http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/ToolLoader.html Or, you can call Class#newInstance from anywhere. See Will's HackingVelocity power point about how to do this. http://wiki.apache.org/jakarta-velocity/HackingVelocity ## Under "An Evil Velocity Template" > And also is there any way to get the reference to the context in > templates when Velocity.mergeTemplate() is being used, though the > context reference is not kept in context. None that I know of. > Is it possible to achieve this ? Any suggestions are most welcome. What would be the risks of adding the two lines to your java code? If none of the templates already use the references "$render" or "$ctx", then I think you can update it without much worry. I also think there was a post in bugzilla some while ago about a toolbox for standalone apps. Best regards, -- Shinobu -- Shinobu Kawai <jasmine05@example.org> --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 06:43:17 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 71337 invoked from network); 3 Mar 2005 06:43:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 06:43:17 -0000 Received: (qmail 84202 invoked by uid 500); 3 Mar 2005 06:43:05 -0000 Delivered-To: jasmine05@example.org Received: (qmail 84182 invoked by uid 500); 3 Mar 2005 06:43:05 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 84167 invoked by uid 99); 3 Mar 2005 06:43:05 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 22:43:04 -0800 Received: by rproxy.gmail.com with SMTP id a41so306166rng for <jasmine05@example.org>; Wed, 02 Mar 2005 22:43:02 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=M6io2QaV6drKOsOJsbtNqcBpapFipMXtyCa17OLsSVKcHBmBWeo7oCTSPBLJmO/KDBrVh2hhVbsgRes460h6YS7LnRdV3jlJk+g7/6Gw394ZrZyTuCQsKFHHmNezC7mA6ZcMZQOaQ/Z7ij9RMc/wUXPkBhWOHPv9nuKDvnaSdaI= Received: by 83.161.120.155 with SMTP id z57mr68115rnb; Wed, 02 Mar 2005 22:42:41 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2005 22:42:40 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Wed, 2 Mar 2005 22:42:40 -0800 From: Shinobu Kawai <jasmine05@example.org> Reply-To: Shinobu Kawai <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: best practice question In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Matthew, > I use a Constants class in my application to hold a bunch of strings > used for things like request attribute keys etc. In my templates, I > would also like to eliminate the hard-coded strings, and I thought I > could do that by using the Constants class as a tool. For the time being, you can try out the FieldMethodizer. http://jakarta.apache.org/velocity/api/org/apache/velocity/app/FieldMethodizer.html Or the PublicFieldUberspect. http://wiki.apache.org/jakarta-velocity/PublicFieldUberspect Best regards, -- Shinobu -- Shinobu Kawai <jasmine05@example.org> --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 07:16:37 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 91687 invoked from network); 3 Mar 2005 07:16:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 07:16:37 -0000 Received: (qmail 13186 invoked by uid 500); 3 Mar 2005 07:16:35 -0000 Delivered-To: jasmine05@example.org Received: (qmail 12954 invoked by uid 500); 3 Mar 2005 07:16:34 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 12939 invoked by uid 99); 3 Mar 2005 07:16:34 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 23:16:33 -0800 Received: by rproxy.gmail.com with SMTP id a41so310377rng for <jasmine05@example.org>; Wed, 02 Mar 2005 23:16:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=ZkrG9+n6bJNC7Pxft/szKF/8MvP3vo3uExIq2O9dwcEC1d1tsgqbhuzSlGBIAC++zuSRDRcdgWNynYzFRZcJJfLAqMJHUFhp+gdpz0cC5frYaZpV/7S5GGQjeeTDOaTyWOgVGoPEyvxda56kLoHqC1zscPu91YrhlBiSbTei0/4= Received: by 83.161.120.155 with SMTP id h6mr79451rna; Wed, 02 Mar 2005 23:16:01 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2005 23:16:01 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Wed, 2 Mar 2005 23:16:01 -0800 From: Shinobu Kawai <jasmine05@example.org> Reply-To: Shinobu Kawai <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: JarResourceLoader In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Stan, > If I use JarResourceLoader, will any uploads of new .jar with > templates be notified by it? > I.e., I first uploaded templates.jar, started webapp, > then reuploaded modified templates.jar - will my modifications > take place without restarting webapplication? It should. If you look at the JarResourceLoader implementation, you'll notice that isSourceModified is always true. Best regards, -- Shinobu -- Shinobu Kawai <jasmine05@example.org> --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 07:40:07 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 3790 invoked from network); 3 Mar 2005 07:40:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 07:40:06 -0000 Received: (qmail 35204 invoked by uid 500); 3 Mar 2005 07:39:54 -0000 Delivered-To: jasmine05@example.org Received: (qmail 35147 invoked by uid 500); 3 Mar 2005 07:39:53 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 35111 invoked by uid 99); 3 Mar 2005 07:39:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 02 Mar 2005 23:39:51 -0800 Received: by rproxy.gmail.com with SMTP id a41so313261rng for <jasmine05@example.org>; Wed, 02 Mar 2005 23:39:48 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=b/iPHmUnR9KZ905PlhoI9QmGERbZSuNFwQpPaBB1j55IunCJR6A8sqUTbJBNAOCb7oEAeuyafpAzT0CxMDZ7X3pOTmg7lNlcar5dm7cngSYrgfPDFWobHLXANyMTW29UATixRjQKOQFFq/xdOVOHrBrELFrPaWvFp394EzQp1r8= Received: by 83.161.120.155 with SMTP id z65mr116810rnd; Wed, 02 Mar 2005 23:39:11 -0800 (PST) Received: by 83.161.120.155 with HTTP; Wed, 2 Mar 2005 23:39:11 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Wed, 2 Mar 2005 23:39:11 -0800 From: Shinobu Kawai <jasmine05@example.org> Reply-To: Shinobu Kawai <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: Enabling logging In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Christophe, > In my effort to find a solution to the problem I mentioned in another post I'm trying to setup minimal Velocity logging... > > There must be something wrong with my setup (or with me :-)). ## snip > 4) velocity.properties content is > > runtime.log = velocity.log > directive.foreach.counter.name = velociCount > directive.foreach.counter.initial.value = 0 > resource.manager.logwhenfound = false > file.resource.loader.cache = true > file.resource.loader.modificationCheckInterval = 2 > velocimacro.library.autoreload = false > velocimacro.permissions.allow.inline = true > velocimacro.permissions.allow.inline.to.replace.global = true > > 5) the velocity.log file is nowhere... Before I had it created under my Eclipse home directory (I'm running Tomcat from Eclipse with Sysdeo plugin).. No matter if I run Tomcat under Eclipse OR standalone the log is nowhere. > > So, to clarify : with this setup, being under cactus or not, with Tomcat standalone or not I have no jasmine05@example.org... The VVS outputs the log via the Servlet API by default. http://jakarta.apache.org/velocity/tools/view/ So you should see it in $CATALINA_HOME/logs/stdout.log for Tomcat. To configure, take a look at the developer guide. http://jakarta.apache.org/velocity/developer-guide.html#Configuring%20the%20Log%20System Best regards, -- Shinobu -- Shinobu Kawai <jasmine05@example.org> --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 08:07:29 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 19773 invoked from network); 3 Mar 2005 08:07:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 08:07:29 -0000 Received: (qmail 66748 invoked by uid 500); 3 Mar 2005 08:07:27 -0000 Delivered-To: jasmine05@example.org Received: (qmail 66724 invoked by uid 500); 3 Mar 2005 08:07:27 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 66711 invoked by uid 99); 3 Mar 2005 08:07:27 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 00:07:27 -0800 Received: by rproxy.gmail.com with SMTP id a41so316856rng for <jasmine05@example.org>; Thu, 03 Mar 2005 00:07:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=USigBppanBnJxcwF0MYpU8KNDmIUA241MSj1h/OuQ2bJ+vJ3B4y3fDiYZ/s80VlbGnWL45dSjElcWPmqGVa2nZmWpR+LqUsavdfZfGiywR+rY+2W7iYPBBh8/UjT9abZcQCU1LgPx7FvGr7fYURkvczmWog/vfeKjwwoVpeV6l0= Received: by 83.161.120.155 with SMTP id u19mr44482rna; Thu, 03 Mar 2005 00:06:56 -0800 (PST) Received: by 83.161.120.155 with HTTP; Thu, 3 Mar 2005 00:06:56 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Thu, 3 Mar 2005 13:36:56 +0530 From: Ravikanth L <jasmine05@example.org> Reply-To: Ravikanth L <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: Creating objects in template using "new" keyword In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Shinobu, Thank you very much for the information. It was a simple java code change only to add two new instances to the context from the java code, but i wanted to avoid java code change. -- With Regards, Ravikanth.L --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 08:49:12 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 68906 invoked from network); 3 Mar 2005 08:49:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 08:49:12 -0000 Received: (qmail 15139 invoked by uid 500); 3 Mar 2005 08:49:10 -0000 Delivered-To: jasmine05@example.org Received: (qmail 15113 invoked by uid 500); 3 Mar 2005 08:49:09 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 15099 invoked by uid 99); 3 Mar 2005 08:49:09 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 00:49:08 -0800 Received: by rproxy.gmail.com with SMTP id a41so322083rng for <jasmine05@example.org>; Thu, 03 Mar 2005 00:49:06 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=WZJD4ayJaDzbmk3XmUUVQHF85++Ysr22Rt0NOEGiEApDLEJ+HEx3DR84c9avR8ei1EIfadA+4rQ87LXD5MiSZg2uIe762PYk2eGLNK1FvnCr/CHPkw/unTRFVgn1odb9pPQZVU0RJn+G9uvv1cPBl0WWAjsgtkP1G3rz3x1CDeE= Received: by 83.161.120.155 with SMTP id h6mr128658rna; Thu, 03 Mar 2005 00:48:47 -0800 (PST) Received: by 83.161.120.155 with HTTP; Thu, 3 Mar 2005 00:48:46 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Thu, 3 Mar 2005 00:48:46 -0800 From: Shinobu Kawai <jasmine05@example.org> Reply-To: Shinobu Kawai <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org> Subject: Re: "For each" on an object? In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi Evan, > I guess its just a usability thing. To be able to pass a single string > would avoid careless errors, that's all. I may settle for what you suggest > though. You can make a custom Uberspect to get what you want. :) http://jakarta.apache.org/velocity/api/org/apache/velocity/util/introspection/Uberspect.html#getIterator(java.lang.Object,%20org.apache.velocity.util.introspection.Info) ie. getIterator returns a one-item iterator for non-iterative objects. Best regards, -- Shinobu -- Shinobu Kawai <jasmine05@example.org> --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 15:44:58 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 18223 invoked from network); 3 Mar 2005 15:44:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 15:44:58 -0000 Received: (qmail 6860 invoked by uid 500); 3 Mar 2005 15:44:55 -0000 Delivered-To: jasmine05@example.org Received: (qmail 6837 invoked by uid 500); 3 Mar 2005 15:44:54 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 6817 invoked by uid 99); 3 Mar 2005 15:44:54 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jasmine05@example.org designates 83.161.120.155 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 07:44:54 -0800 Received: by wproxy.gmail.com with SMTP id 58so566129wri for <jasmine05@example.org>; Thu, 03 Mar 2005 07:44:52 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=ODC13g2J9hsH2cdezsoA1fiQHYngBWAmK4+jbl5DjMwsJ1KHNXPoNPHmeS5+hviRQsKaARU8klCTQXF70vfnh1Y4/83G7VNSHwm8qiQCos7dLLeED7AsGr8O8QMVF92ghpfVSCxOksdCysR0kqHB4A7lf3k75OR9cytW2EQef38= Received: by 83.161.120.155 with SMTP id n3mr21872wra; Thu, 03 Mar 2005 07:44:51 -0800 (PST) Received: by 83.161.120.155 with HTTP; Thu, 3 Mar 2005 07:44:51 -0800 (PST) Message-ID: <jasmine05@example.org> Date: Thu, 3 Mar 2005 07:44:51 -0800 From: Nathan Bubna <jasmine05@example.org> Reply-To: Nathan Bubna <jasmine05@example.org> To: Velocity Users List <jasmine05@example.org>, Shinobu Kawai <jasmine05@example.org> Subject: Re: Creating objects in template using "new" keyword In-Reply-To: <jasmine05@example.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <jasmine05@example.org> <jasmine05@example.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 2 Mar 2005 22:33:47 -0800, Shinobu Kawai <jasmine05@example.org> wrote: > Hi Ravikanth, > > > I would like to create a object reference in template using "new" > > keyword like what we do in java > > > > String obj = new String() <cringe>not a best practice!</cringe> :) > > I need to put RenderTool instance in context and use it to fix some > > problem. I know that i can put it to context from the java code where > > the template is being called or using toolbox.xml But as my > > application is standalone and in production and i don't want to change > > the java code to fix the issue, i want to handle it in template. > > If you really, really, really want to do it, check out the deprecated > ToolLoader. > http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/generic/ToolLoader.html but this is gone in VelocityTools 1.2 > Or, you can call Class#newInstance from anywhere. > See Will's HackingVelocity power point about how to do this. > http://wiki.apache.org/jakarta-velocity/HackingVelocity > ## Under "An Evil Velocity Template" if you have to do this, i recommend this way. just to make sure it's clear that it's not a good thing to be doing. ;-) > > And also is there any way to get the reference to the context in > > templates when Velocity.mergeTemplate() is being used, though the > > context reference is not kept in context. > > None that I know of. > > > Is it possible to achieve this ? Any suggestions are most welcome. > > What would be the risks of adding the two lines to your java code? If > none of the templates already use the references "$render" or "$ctx", > then I think you can update it without much worry. > > I also think there was a post in bugzilla some while ago about a > toolbox for standalone apps. > > Best regards, > -- Shinobu > > -- > Shinobu Kawai <jasmine05@example.org> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jasmine05@example.org > For additional commands, e-mail: jasmine05@example.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Thu Mar 03 16:41:07 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 48031 invoked from network); 3 Mar 2005 16:41:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 3 Mar 2005 16:41:07 -0000 Received: (qmail 50834 invoked by uid 500); 3 Mar 2005 16:40:56 -0000 Delivered-To: jasmine05@example.org Received: (qmail 50801 invoked by uid 500); 3 Mar 2005 16:40:56 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 50784 invoked by uid 99); 3 Mar 2005 16:40:56 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from keiko.intelligenthosting.net (HELO keiko.intelligenthosting.net) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 08:40:54 -0800 Received: (qmail 5763 invoked from network); 3 Mar 2005 16:40:52 -0000 Received: from unknown (HELO Manta) (83.161.120.155) by 83.161.120.155 with SMTP; 3 Mar 2005 16:40:52 -0000 From: "e v a n l e o n a r d" <jasmine05@example.org> To: "'Velocity Users List'" <jasmine05@example.org>, "'Shinobu Kawai'" <jasmine05@example.org> Subject: RE: "For each" on an object? Date: Thu, 3 Mar 2005 11:40:49 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: <jasmine05@example.org> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Thread-Index: AcUfzd5nDL8wsgUyTJSFuoeogfDtswAQdWrA X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hmm.. There's a neat idea.. I'll look into that. Thanks! -Evan -----Original Message----- From: Shinobu Kawai [mailto:jasmine05@example.org] Sent: Thursday, March 03, 2005 3:49 AM To: Velocity Users List Subject: Re: "For each" on an object? Hi Evan, > I guess its just a usability thing. To be able to pass a single > string would avoid careless errors, that's all. I may settle for what > you suggest though. You can make a custom Uberspect to get what you want. :) http://jakarta.apache.org/velocity/api/org/apache/velocity/util/introspectio n/Uberspect.html#getIterator(java.lang.Object,%20org.apache.velocity.util.in trospection.Info) ie. getIterator returns a one-item iterator for non-iterative objects. Best regards, -- Shinobu -- Shinobu Kawai <jasmine05@example.org> --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Fri Mar 04 04:07:51 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 83404 invoked from network); 4 Mar 2005 04:07:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 4 Mar 2005 04:07:51 -0000 Received: (qmail 22526 invoked by uid 500); 4 Mar 2005 04:07:40 -0000 Delivered-To: jasmine05@example.org Received: (qmail 22504 invoked by uid 500); 4 Mar 2005 04:07:39 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 22490 invoked by uid 99); 4 Mar 2005 04:07:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mailpipe.athena.thinkhost.com (HELO athena.thinkhost.com) (83.161.120.155) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 03 Mar 2005 20:07:37 -0800 Received: from stan (itpremium.omsk.ru [83.161.120.155]) by athena.thinkhost.com (8.13.2/8.13.2) with ESMTP id j2447Jic021220; Thu, 3 Mar 2005 23:07:21 -0500 (EST) (envelope-from jasmine05@example.org) Date: Fri, 4 Mar 2005 10:06:14 +0600 From: Stan Devyatovsky <jasmine05@example.org> X-Mailer: The Bat! (v1.61) Reply-To: Stan Devyatovsky <jasmine05@example.org> X-Priority: 3 (Normal) Message-ID: <jasmine05@example.org> To: "Velocity Users List" <jasmine05@example.org>, Shinobu Kawai <jasmine05@example.org> Subject: Re[2]: JarResourceLoader In-Reply-To: <jasmine05@example.org> References: <jasmine05@example.org> <jasmine05@example.org> <jasmine05@example.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello Shinobu, >> If I use JarResourceLoader, will any uploads of new .jar with >> templates be notified by it? >> I.e., I first uploaded templates.jar, started webapp, >> then reuploaded modified templates.jar - will my modifications >> take place without restarting webapplication? SK> It should. If you look at the JarResourceLoader implementation, SK> you'll notice that isSourceModified is always true. In that case, it will always recompile the Velocity templates from .JAR file, no matter what? That's not too performance-wise in that case. -- Best regards, Stan mailto:jasmine05@example.org --------------------------------------------------------------------- To unsubscribe, e-mail: jasmine05@example.org For additional commands, e-mail: jasmine05@example.org From velocity-user-returnjasmine05@example.org Fri Mar 04 11:17:34 2005 Return-Path: <velocity-user-returnjasmine05@example.org> Delivered-To: jasmine05@example.org Received: (qmail 70186 invoked from network); 4 Mar 2005 11:17:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur-2.apache.org with SMTP; 4 Mar 2005 11:17:34 -0000 Received: (qmail 81306 invoked by uid 500); 4 Mar 2005 11:17:32 -0000 Delivered-To: jasmine05@example.org Received: (qmail 80849 invoked by uid 500); 4 Mar 2005 11:17:30 -0000 Mailing-List: contact jasmine05@example.org; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:jasmine05@example.org> List-Subscribe: <mailto:jasmine05@example.org> List-Help: <mailto:jasmine05@example.org> List-Post: <mailto:jasmine05@example.org> List-Id: "Velocity Users List" <velocity-user.jakarta.apache.org> Reply-To: "Velocity Users List" <jasmine05@example.org> Delivered-To: mailing list jasmine05@example.org Received: (qmail 80833 invoked
{'source': 'Apache Software Foundation Public Mail Archives'}