<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>dev@velocity.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/velocity-dev/"/>
<id>http://mail-archives.apache.org/mod_mbox/velocity-dev/</id>
<updated>2009-12-10T01:30:01Z</updated>
<entry>
<title>Re: Velocity Engine 1.6.3 test build available</title>
<author><name>Malcolm Edgar &lt;malcolm.edgar@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c525d8e10912071807s78c6243o1debc87802058cd4@mail.gmail.com%3e"/>
<id>urn:uuid:%3c525d8e10912071807s78c6243o1debc87802058cd4@mail-gmail-com%3e</id>
<updated>2009-12-08T02:07:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Many thanks for your help Nathan,

regards Malcolm Edgar

On Tue, Dec 8, 2009 at 10:18 AM, Nathan Bubna &lt;nbubna@gmail.com&gt; wrote:
&gt; Ok, it seems to me that VELOCITY-731 set back performance enough for
&gt; people that we should not wait for 1.7 to have an official release
&gt; with the new "directive.if.tostring.nullcheck" config switch
&gt; available.  So, here's a 1.6.3 test build.  Please try it out and
&gt; report problems ASAP. :)
&gt;
&gt; http://people.apache.org/~nbubna/velocity/engine/1.6.3/
&gt;
&gt; I plan to call for a release vote on Fri (12/11), aiming for a 12/16
&gt; release date.
&gt;
&gt; (personal note: based on rev 888167 in the 1.6.x branch)
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
&gt; For additional commands, e-mail: dev-help@velocity.apache.org
&gt;
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELOCITY-736) Introspection regression from 1.5 to 1.6.2</title>
<author><name>&quot;Nathan Bubna (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c112833783.1260228258140.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c112833783-1260228258140-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T23:24:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELOCITY-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12787191#action_12787191
] 

Nathan Bubna commented on VELOCITY-736:
---------------------------------------

I was unable to duplicate this in a test case, so fixing is rather problematic.  I do, however,
intend to move forward on VELOCITY-745 prior to a 1.7 release.  That, i hope, would render
this a non-problem.

&gt; Introspection regression from 1.5 to 1.6.2
&gt; ------------------------------------------
&gt;
&gt;                 Key: VELOCITY-736
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-736
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;         Environment: Sun JDK 1.6.0_16
&gt;            Reporter: David Esposito
&gt;         Attachments: Velocity736TestCase.java
&gt;
&gt;
&gt; When upgrading from Velcocity 1.5 to 1.6.2, the following snippet of code changed behavior.

&gt; In Velocity 1.5, the output was:
&gt; The file upload exceeded 100
&gt; In Velocity 1.6.2, the output is:
&gt; The file upload exceeded $ex.permittedSize
&gt; There is nothing in the velocity log file to help me identify why it's not resolving
'permittedSize' to the correct bean method.
&gt; Here is a test program to replicate the problem. The context variable in question is
the Commons FileUpload exception class documented here:
&gt; http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileUploadBase.SizeLimitExceededException.html
&gt; I am using commons-fileupload-1.2.jar
&gt; import java.io.StringWriter;
&gt; import org.apache.commons.fileupload.FileUploadBase;
&gt; import org.apache.velocity.VelocityContext;
&gt; import org.apache.velocity.app.VelocityEngine;
&gt; import org.apache.velocity.context.Context;
&gt; public class Main {
&gt;     public static void main(String[] args) throws Exception{
&gt;         VelocityEngine e = new VelocityEngine();
&gt; 		String testTemplate = "The file upload exceeded $ex.permittedSize";
&gt; 		StringWriter out = new StringWriter();
&gt; 		Context ctx = new VelocityContext();
&gt; 		FileUploadBase.FileSizeLimitExceededException ex = new FileUploadBase.FileSizeLimitExceededException("too
big!", 50, 100);
&gt; 		ctx.put("ex",ex);
&gt; 		e.evaluate(ctx, out, "Tester", testTemplate);
&gt; 		System.out.println(out.toString());
&gt;     }
&gt; }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-745) Modify ClassMap.java to use getMethods() rather than get getDeclaredMethods()</title>
<author><name>&quot;Nathan Bubna (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c318367302.1260228138399.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c318367302-1260228138399-JavaMail-jira@brutus%3e</id>
<updated>2009-12-07T23:22:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nathan Bubna updated VELOCITY-745:
----------------------------------


If there were once reasons for doing it as it currently is done, i've been unable to think
of them so far.  I'll aim to deal with this before any 1.7 release.  It ought to simplify
things, and simply trying it is probably the best way to see if there's something i'm overlooking.

&gt; Modify ClassMap.java to use getMethods() rather than get getDeclaredMethods()
&gt; -----------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-745
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-745
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;         Environment: All
&gt;            Reporter: Steve O'Hara
&gt;            Priority: Minor
&gt;
&gt; The code that recurses up the super classes to find all public methods using getDeclaredMethods()
is now redundant and can be replaced with a single call to getMethods() - this intrinsically
provides all inherited public methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Velocity Engine 1.6.3 test build available</title>
<author><name>Nathan Bubna &lt;nbubna@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c4d651da50912071518o216dd307ycbf3f73027b2be74@mail.gmail.com%3e"/>
<id>urn:uuid:%3c4d651da50912071518o216dd307ycbf3f73027b2be74@mail-gmail-com%3e</id>
<updated>2009-12-07T23:18:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Ok, it seems to me that VELOCITY-731 set back performance enough for
people that we should not wait for 1.7 to have an official release
with the new "directive.if.tostring.nullcheck" config switch
available.  So, here's a 1.6.3 test build.  Please try it out and
report problems ASAP. :)

http://people.apache.org/~nbubna/velocity/engine/1.6.3/

I plan to call for a release vote on Fri (12/11), aiming for a 12/16
release date.

(personal note: based on rev 888167 in the 1.6.x branch)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: VELOCITY-731</title>
<author><name>Malcolm Edgar &lt;malcolm.edgar@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c525d8e10912071426m2f34f8c2v41b612a85986cb2@mail.gmail.com%3e"/>
<id>urn:uuid:%3c525d8e10912071426m2f34f8c2v41b612a85986cb2@mail-gmail-com%3e</id>
<updated>2009-12-07T22:26:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Great, always look forward to new Velocity releases.

thanks Malcolm Edgar

On Tue, Dec 8, 2009 at 8:28 AM, Nathan Bubna &lt;nbubna@gmail.com&gt; wrote:
&gt; Plans?  Nope.  But now that you mention it, i think i can make the
&gt; time to kick that process off.  Of course, i may request help, if i've
&gt; overestimated my availability. :)
&gt;
&gt; 2009/12/6 Malcolm Edgar &lt;malcolm.edgar@gmail.com&gt;:
&gt;&gt; Hi All,
&gt;&gt;
&gt;&gt; Are there any plans to release 1.6.3 in the near future? We are
&gt;&gt; looking to include VELOCITY-731 in Apache Click.
&gt;&gt;
&gt;&gt; regards Malcolm Edgar
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
&gt;&gt; For additional commands, e-mail: dev-help@velocity.apache.org
&gt;&gt;
&gt;&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
&gt; For additional commands, e-mail: dev-help@velocity.apache.org
&gt;
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: VELOCITY-731</title>
<author><name>Nathan Bubna &lt;nbubna@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c4d651da50912071328q18d2aabcuace1478e998fda0d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c4d651da50912071328q18d2aabcuace1478e998fda0d@mail-gmail-com%3e</id>
<updated>2009-12-07T21:28:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Plans?  Nope.  But now that you mention it, i think i can make the
time to kick that process off.  Of course, i may request help, if i've
overestimated my availability. :)

2009/12/6 Malcolm Edgar &lt;malcolm.edgar@gmail.com&gt;:
&gt; Hi All,
&gt;
&gt; Are there any plans to release 1.6.3 in the near future? We are
&gt; looking to include VELOCITY-731 in Apache Click.
&gt;
&gt; regards Malcolm Edgar
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
&gt; For additional commands, e-mail: dev-help@velocity.apache.org
&gt;
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>VELOCITY-731</title>
<author><name>Malcolm Edgar &lt;malcolm.edgar@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c525d8e10912061905i27c91017i8daf44e0fb9be83d@mail.gmail.com%3e"/>
<id>urn:uuid:%3c525d8e10912061905i27c91017i8daf44e0fb9be83d@mail-gmail-com%3e</id>
<updated>2009-12-07T03:05:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi All,

Are there any plans to release 1.6.3 in the near future? We are
looking to include VELOCITY-731 in Apache Click.

regards Malcolm Edgar

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-747) Macros with same name in different templates creates issue when VelocityEngine initialized with init(Properties) method</title>
<author><name>&quot;Ravikanth L (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c542089065.1259760260663.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c542089065-1259760260663-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T13:24:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ravikanth L updated VELOCITY-747:
---------------------------------

    Attachment: VelocityInitializationExample.ZIP

&gt; Macros with same name in different templates creates issue when VelocityEngine initialized
with init(Properties) method
&gt; -----------------------------------------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-747
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-747
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.x
&gt;            Reporter: Ravikanth L
&gt;         Attachments: VelocityInitializationExample.ZIP
&gt;
&gt;
&gt; I have two different templates with same macro names performing different functions.
Works fine when VelocityEngine is initialized with init(propsFileName).
&gt; When VelocityEngine is initialized with init(Properties), macro defined in template1
will be used when macro defined in template2 is called.
&gt; Ex:
&gt; one.vm:
&gt; #macro ( myMacro )
&gt; This is from myMacro macro of one.vm
&gt; #end
&gt; #myMacro
&gt; two.vm
&gt; #macro ( myMacro )
&gt; This is from myMacro macro of two.vm
&gt; #end
&gt; #myMacro
&gt; settings in my velocity.properties:
&gt; directive.foreach.counter.initial.value = 1
&gt; file.resource.loader.path = E:/Programs
&gt; file.resource.loader.cache = true
&gt; file.resource.loader.modificationCheckInterval = -1
&gt; velocimacro.permissions.allow.inline.local.scope = true  
&gt; directive.set.null.allowed = true
&gt; velocimacro.max.depth = -1
&gt; code in java file:
&gt; 		VelocityEngine engine = new VelocityEngine();
&gt; 		Properties props = new Properties();
&gt; 		props.load( new FileInputStream("velocity.properties") );
&gt; 		engine.init(props);
&gt;                 //engine.init("velocity.properties");
&gt; 		StringWriter writer = new StringWriter();
&gt; 		VelocityContext ctx = new VelocityContext();
&gt; 		engine.mergeTemplate("one.vm","UTF-8", ctx,writer);
&gt; 		System.out.println("Template 1 output:" + writer.toString());
&gt; 		StringWriter writerTwo = new StringWriter();
&gt; 		engine.mergeTemplate("two.vm","UTF-8", ctx,writerTwo);
&gt; 		System.out.println("Template 2 output:" + writerTwo.toString());
&gt; Expected output :
&gt; Template 1 output:This is from Test1 macro of one.vm
&gt; Template 2 output:This is from Test1 macro of two.vm
&gt; Actual output:
&gt; Template 1 output:This is from Test1 macro of one.vm
&gt; Template 2 output:This is from Test1 macro of one.vm
&gt; But with the same code will work properly when initialized with the commented line i.e.
engine.init("velocity.properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-747) Macros with same name in different templates creates issue when VelocityEngine initialized with init(Properties) method</title>
<author><name>&quot;Ravikanth L (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c1458150079.1259760140788.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1458150079-1259760140788-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T13:22:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ravikanth L updated VELOCITY-747:
---------------------------------

    Description: 
I have two different templates with same macro names performing different functions. Works
fine when VelocityEngine is initialized with init(propsFileName).

When VelocityEngine is initialized with init(Properties), macro defined in template1 will
be used when macro defined in template2 is called.

Ex:

one.vm:
#macro ( myMacro )
This is from myMacro macro of one.vm
#end
#myMacro

two.vm
#macro ( myMacro )
This is from myMacro macro of two.vm
#end
#myMacro

settings in my velocity.properties:
directive.foreach.counter.initial.value = 1
file.resource.loader.path = E:/Programs
file.resource.loader.cache = true
file.resource.loader.modificationCheckInterval = -1

velocimacro.permissions.allow.inline.local.scope = true  
directive.set.null.allowed = true
velocimacro.max.depth = -1

code in java file:

		VelocityEngine engine = new VelocityEngine();
		Properties props = new Properties();
		props.load( new FileInputStream("velocity.properties") );
		engine.init(props);
                //engine.init("velocity.properties");

		StringWriter writer = new StringWriter();
		VelocityContext ctx = new VelocityContext();

		engine.mergeTemplate("one.vm","UTF-8", ctx,writer);
		System.out.println("Template 1 output:" + writer.toString());

		StringWriter writerTwo = new StringWriter();
		engine.mergeTemplate("two.vm","UTF-8", ctx,writerTwo);
		System.out.println("Template 2 output:" + writerTwo.toString());

Expected output :
Template 1 output:This is from Test1 macro of one.vm

Template 2 output:This is from Test1 macro of two.vm

Actual output:
Template 1 output:This is from Test1 macro of one.vm

Template 2 output:This is from Test1 macro of one.vm

But with the same code will work properly when initialized with the commented line i.e. engine.init("velocity.properties");

  was:
I have two different templates with same macro names performing different functions. Works
fine when VelocityEngine is initialized with init(propsFileName).

When VelocityEngine is initialized with init(Properties), macro defined in template1 will
be used when macro defined in template2 is called.

Ex:

one.vm:
#macro ( myMacro )
This is from myMacro macro of one.vm
#end
#myMacro

two.vm
#macro ( myMacro )
This is from myMacro macro of two.vm
#end
#myMacro

settings in my velocity.properties:
directive.foreach.counter.initial.value = 1
file.resource.loader.path = E:/Programs
file.resource.loader.cache = true
file.resource.loader.modificationCheckInterval = -1

velocimacro.permissions.allow.inline.local.scope = true  
directive.set.null.allowed = true
velocimacro.max.depth = -1

code in java file:

		VelocityEngine engine = new VelocityEngine();
		Properties props = new Properties();
		props.load( new FileInputStream("velocity.properties") );
		engine.init(props);
                //engine.init("velocity.properties");
		StringWriter writer = new StringWriter();
		VelocityContext ctx = new VelocityContext();
		engine.mergeTemplate("one.vm","UTF-8", ctx,writer);
		System.out.println("Template 1 output:" + writer.toString());
		StringWriter writerTwo = new StringWriter();
		engine.mergeTemplate("two.vm","UTF-8", ctx,writerTwo);
		System.out.println("Template 2 output:" + writerTwo.toString());

Expected output :
Template 1 output:This is from Test1 macro of one.vm

Template 2 output:This is from Test1 macro of two.vm

Actual output:
Template 1 output:This is from Test1 macro of one.vm

Template 2 output:This is from Test1 macro of one.vm

But with the same code will work properly when initialized with the commented line i.e. engine.init("velocity.properties");


&gt; Macros with same name in different templates creates issue when VelocityEngine initialized
with init(Properties) method
&gt; -----------------------------------------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-747
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-747
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.x
&gt;            Reporter: Ravikanth L
&gt;
&gt; I have two different templates with same macro names performing different functions.
Works fine when VelocityEngine is initialized with init(propsFileName).
&gt; When VelocityEngine is initialized with init(Properties), macro defined in template1
will be used when macro defined in template2 is called.
&gt; Ex:
&gt; one.vm:
&gt; #macro ( myMacro )
&gt; This is from myMacro macro of one.vm
&gt; #end
&gt; #myMacro
&gt; two.vm
&gt; #macro ( myMacro )
&gt; This is from myMacro macro of two.vm
&gt; #end
&gt; #myMacro
&gt; settings in my velocity.properties:
&gt; directive.foreach.counter.initial.value = 1
&gt; file.resource.loader.path = E:/Programs
&gt; file.resource.loader.cache = true
&gt; file.resource.loader.modificationCheckInterval = -1
&gt; velocimacro.permissions.allow.inline.local.scope = true  
&gt; directive.set.null.allowed = true
&gt; velocimacro.max.depth = -1
&gt; code in java file:
&gt; 		VelocityEngine engine = new VelocityEngine();
&gt; 		Properties props = new Properties();
&gt; 		props.load( new FileInputStream("velocity.properties") );
&gt; 		engine.init(props);
&gt;                 //engine.init("velocity.properties");
&gt; 		StringWriter writer = new StringWriter();
&gt; 		VelocityContext ctx = new VelocityContext();
&gt; 		engine.mergeTemplate("one.vm","UTF-8", ctx,writer);
&gt; 		System.out.println("Template 1 output:" + writer.toString());
&gt; 		StringWriter writerTwo = new StringWriter();
&gt; 		engine.mergeTemplate("two.vm","UTF-8", ctx,writerTwo);
&gt; 		System.out.println("Template 2 output:" + writerTwo.toString());
&gt; Expected output :
&gt; Template 1 output:This is from Test1 macro of one.vm
&gt; Template 2 output:This is from Test1 macro of two.vm
&gt; Actual output:
&gt; Template 1 output:This is from Test1 macro of one.vm
&gt; Template 2 output:This is from Test1 macro of one.vm
&gt; But with the same code will work properly when initialized with the commented line i.e.
engine.init("velocity.properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELOCITY-747) Macros with same name in different templates creates issue when VelocityEngine initialized with init(Properties) method</title>
<author><name>&quot;Ravikanth L (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c1825535500.1259760023391.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1825535500-1259760023391-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T13:20:23Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Macros with same name in different templates creates issue when VelocityEngine initialized
with init(Properties) method
-----------------------------------------------------------------------------------------------------------------------

                 Key: VELOCITY-747
                 URL: https://issues.apache.org/jira/browse/VELOCITY-747
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.6.x
            Reporter: Ravikanth L


I have two different templates with same macro names performing different functions. Works
fine when VelocityEngine is initialized with init(propsFileName).

When VelocityEngine is initialized with init(Properties), macro defined in template1 will
be used when macro defined in template2 is called.

Ex:

one.vm:
#macro ( myMacro )
This is from myMacro macro of one.vm
#end
#myMacro

two.vm
#macro ( myMacro )
This is from myMacro macro of two.vm
#end
#myMacro

settings in my velocity.properties:
directive.foreach.counter.initial.value = 1
file.resource.loader.path = E:/Programs
file.resource.loader.cache = true
file.resource.loader.modificationCheckInterval = -1

velocimacro.permissions.allow.inline.local.scope = true  
directive.set.null.allowed = true
velocimacro.max.depth = -1

code in java file:

		VelocityEngine engine = new VelocityEngine();
		Properties props = new Properties();
		props.load( new FileInputStream("velocity.properties") );
		engine.init(props);
                //engine.init("velocity.properties");
		StringWriter writer = new StringWriter();
		VelocityContext ctx = new VelocityContext();
		engine.mergeTemplate("one.vm","UTF-8", ctx,writer);
		System.out.println("Template 1 output:" + writer.toString());
		StringWriter writerTwo = new StringWriter();
		engine.mergeTemplate("two.vm","UTF-8", ctx,writerTwo);
		System.out.println("Template 2 output:" + writerTwo.toString());

Expected output :
Template 1 output:This is from Test1 macro of one.vm

Template 2 output:This is from Test1 macro of two.vm

Actual output:
Template 1 output:This is from Test1 macro of one.vm

Template 2 output:This is from Test1 macro of one.vm

But with the same code will work properly when initialized with the commented line i.e. engine.init("velocity.properties");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELOCITY-746) Add Info to MethodExceptionEventHandler.methodException parameter</title>
<author><name>&quot;Siri C. (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200912.mbox/%3c1719986598.1259726420660.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1719986598-1259726420660-JavaMail-jira@brutus%3e</id>
<updated>2009-12-02T04:00:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Add Info to MethodExceptionEventHandler.methodException parameter
-----------------------------------------------------------------

                 Key: VELOCITY-746
                 URL: https://issues.apache.org/jira/browse/VELOCITY-746
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 1.6.2
            Reporter: Siri C.


I can't get information where exception is occurs from method exception handler.
The exception handler method contains nothing about line of error. 

{code}
MethodExceptionEventHandler.methodException(Class class1, String s, Exception exception)
{code}

Compare with InvalidReferenceEventHandler

{code}
InvalidReferenceEventHandler.invalidGetMethod(Context context, String s, Object obj, String
s1, Info info);
InvalidReferenceEventHandler.invalidSetMethod(Context context, String s, String s1, Info info);
InvalidReferenceEventHandler.invalidMethod(Context context, String s, Object obj, String s1,
Info info);
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Extensive memory usage</title>
<author><name>&quot;Ludwig Magnusson&quot; &lt;ludwig@itcatapult.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c007601ca6dbc$e0667250$a13356f0$@com%3e"/>
<id>urn:uuid:%3c007601ca6dbc$e0667250$a13356f0$@com%3e</id>
<updated>2009-11-25T10:48:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi!

I am using torque in one of my projects to manage the database. Torque uses
velocity to generate sql-files for the data to be inserted in the database.
For those not familiar with torque it takes (in my case) an xml-file, like
this one:

 

&lt;dataset name="all"&gt;

  &lt;Role Id="0" Name="Role_0"/&gt;

  &lt;Role Id="1" Name="Role_1"/&gt;

  .

  &lt;Role Id="n" Name="Role_n"/&gt;

&lt;/dataset&gt;

 

And creates an sql-file like this one:

 

INSERT INTO role (id,name)

    VALUES (1,'Role_1');

 

INSERT INTO role (id,name)

    VALUES (2,'Role_2');

.

 

INSERT INTO role (id,name)

    VALUES (n,'Role_n');

 

A problem I encountered was that when working with large files (but normal
size for describing databases) was that the program threw an
java.lang.OutOfMemoryError. It turns out that for an input xml-file of 60Kb,
that generates an output file of 100 Kb, the program used 50Mb of memory.
The amount of memory used was proportional to the size of the input file.
For my actual database file, which currently has a size of ca 700kb, the
program needs 415Mb of memory. It seems to me that a great efficiency
improvement could be done here. And even though we have access to a lot of
memory, extending the allowed amount of memory for the program doesn't seem
like a long term solution if the database grows.

We did some tracking using Java Visual VM, which confirms memory usage
constantly increasing while running the program. The velocity engine creates
a lot of instances of org.apache.velocity.runtime.parser.Token that are
never garbage collected. It also creates a lot of strings and chars, but
they, or some of them, are destroyed when running the GC. I'm not very
familiar with the velocity code and I don't know if all the instances of the
token class are needed or if they can be destroyed over time. That said, one
can of course not say that the token class definitely is the reason for the
crash.

I have tried this with velocity 1.5 and 1.6.2. It said in the release notes
that velocity 1.6 contained a major performance improvement but I could not
notice any difference in this case.

 

Does anyone have any ideas about this?

/Ludwig



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELTOOLS-123) Layout Servlet: Look for alternate layout in request attribute</title>
<author><name>&quot;Frederic Daoud (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c153335396.1258919079706.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c153335396-1258919079706-JavaMail-jira@brutus%3e</id>
<updated>2009-11-22T19:44:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELTOOLS-123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12781201#action_12781201
] 

Frederic Daoud commented on VELTOOLS-123:
-----------------------------------------

Thanks again for adding this. I am using Velocity Tools in Rayures[1].
[1]: http://www.stripesbook.com/rayures.html


&gt; Layout Servlet: Look for alternate layout in request attribute
&gt; --------------------------------------------------------------
&gt;
&gt;                 Key: VELTOOLS-123
&gt;                 URL: https://issues.apache.org/jira/browse/VELTOOLS-123
&gt;             Project: Velocity Tools
&gt;          Issue Type: Improvement
&gt;          Components: VelocityView
&gt;    Affects Versions: 1.4
&gt;            Reporter: Frederic Daoud
&gt;             Fix For: 2.0, 2.x
&gt;
&gt;
&gt; The layout servlet looks for an alternate layout in the request parameters, and in the
context (e.g. #set($layout="...").
&gt; It would be very useful if it would also look in the request attributes, e.g. request.getAttribute("layout").
This would allow a servlet filter to specify which layout to use, according to whatever criteria,
by setting the layout as a request attribute.
&gt; This improvement is very easy to add, and it would be oh so useful!
&gt; VelocityLayoutServlet.java (1.4):
&gt;     protected Context createContext(HttpServletRequest request,
&gt;                                     HttpServletResponse response)
&gt;     {
&gt;         Context ctx = super.createContext(request, response);
&gt;         // check if an alternate layout has been specified
&gt;         // by way of the request parameters
&gt;         String layout = request.getParameter(KEY_LAYOUT);
&gt;         // also look in the request attributes
&gt;         if (layout == null)
&gt;         {
&gt;             layout = request.getAttribute(KEY_LAYOUT);
&gt;         }
&gt;         if (layout != null)
&gt;         {
&gt;             // let the template know what its new layout is
&gt;             ctx.put(KEY_LAYOUT, layout);
&gt;         }
&gt;         return ctx;
&gt;     }
&gt; Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELOCITY-745) Modify ClassMap.java to use getMethods() rather than get getDeclaredMethods()</title>
<author><name>&quot;Steve O'Hara (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c298072053.1258670979731.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c298072053-1258670979731-JavaMail-jira@brutus%3e</id>
<updated>2009-11-19T22:49:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Modify ClassMap.java to use getMethods() rather than get getDeclaredMethods()
-----------------------------------------------------------------------------

                 Key: VELOCITY-745
                 URL: https://issues.apache.org/jira/browse/VELOCITY-745
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 1.6.2
         Environment: All
            Reporter: Steve O'Hara
            Priority: Minor


The code that recurses up the super classes to find all public methods using getDeclaredMethods()
is now redundant and can be replaced with a single call to getMethods() - this intrinsically
provides all inherited public methods.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELOCITY-744) No more VM adding logs</title>
<author><name>&quot;Alexandre Garnier (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c305153510.1258654299738.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c305153510-1258654299738-JavaMail-jira@brutus%3e</id>
<updated>2009-11-19T18:11:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
No more VM adding logs
----------------------

                 Key: VELOCITY-744
                 URL: https://issues.apache.org/jira/browse/VELOCITY-744
             Project: Velocity
          Issue Type: Bug
          Components: Engine
    Affects Versions: 1.6.2
            Reporter: Alexandre Garnier
            Priority: Minor


org.apache.velocity.runtime.VelocimacroFactory.addVelocimacro(String, String, String[], String)
add a log "added &lt;VMName&gt; : source = &lt;VMBody&gt;"
The new 1.6 method org.apache.velocity.runtime.VelocimacroFactory.addVelocimacro(String, Node,
String[], String) no more log this.

The first one is used by org.apache.velocity.runtime.RuntimeInstance.addVelocimacro(String,
String, String[], String) which is now deprecated for org.apache.velocity.runtime.RuntimeInstance.addVelocimacro(String,
Node, String[], String) which use the new VelocimacroFactory.addVelocimacro

This logs was usefull for debug.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELTOOLS-124) LoopTool fails to retrieve $loop.index, $loop.first etc for the last element in a collection.</title>
<author><name>&quot;Sergiy Kovalchuk (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c922039125.1258499679696.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c922039125-1258499679696-JavaMail-jira@brutus%3e</id>
<updated>2009-11-17T23:14:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
LoopTool fails to retrieve $loop.index, $loop.first etc for the last element in a collection.
---------------------------------------------------------------------------------------------

                 Key: VELTOOLS-124
                 URL: https://issues.apache.org/jira/browse/VELTOOLS-124
             Project: Velocity Tools
          Issue Type: Bug
          Components: GenericTools
    Affects Versions: 2.x
         Environment: velocity-tools-2.0-beta4 with velocity-1.6.2
            Reporter: Sergiy Kovalchuk
             Fix For: 2.x


$loop.index, $loop.first and other LoopTool methods (that depend on iterator) return null
for the last element in a collection.

Try to run:
#set( $list = [1..3] )
#foreach($i in $loop.watch($list))
     $i - ${loop.index},
#end

The result is:
i[0]=1; i[1]=2; i[${loop.index}]=3; 

I tried to investigate it a little, and seems like the problem is  inside  "cacheNext(boolean
popWhenDone)".

First it checks if (!iterator.hasNext()) and if not then removes this iterator from the stack.
But later in this method it retrieves next element from a collection "this.next = iterator.next();".
Seems like it causes removing iterator too early, when calling ${loop.index} on the last element
the iterator is already removed.

Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELTOOLS-124) LoopTool fails to retrieve $loop.index, $loop.first etc for the last element in a collection.</title>
<author><name>&quot;Sergiy Kovalchuk (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1969235532.1258499679834.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1969235532-1258499679834-JavaMail-jira@brutus%3e</id>
<updated>2009-11-17T23:14:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELTOOLS-124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sergiy Kovalchuk updated VELTOOLS-124:
--------------------------------------

    Description: 
$loop.index, $loop.first and other LoopTool methods (that depend on iterator) return null
for the last element in a collection.

Try to run:
#set( $list = [1..3] )
#foreach($i in $loop.watch($list))
	i[${loop.index}]=$i;
#end

The result is:
i[0]=1; i[1]=2; i[${loop.index}]=3; 

I tried to investigate it a little, and seems like the problem is  inside  "cacheNext(boolean
popWhenDone)".

First it checks if (!iterator.hasNext()) and if not then removes this iterator from the stack.
But later in this method it retrieves next element from a collection "this.next = iterator.next();".
Seems like it causes removing iterator too early, when calling ${loop.index} on the last element
the iterator is already removed.

Thanks.

  was:
$loop.index, $loop.first and other LoopTool methods (that depend on iterator) return null
for the last element in a collection.

Try to run:
#set( $list = [1..3] )
#foreach($i in $loop.watch($list))
     $i - ${loop.index},
#end

The result is:
i[0]=1; i[1]=2; i[${loop.index}]=3; 

I tried to investigate it a little, and seems like the problem is  inside  "cacheNext(boolean
popWhenDone)".

First it checks if (!iterator.hasNext()) and if not then removes this iterator from the stack.
But later in this method it retrieves next element from a collection "this.next = iterator.next();".
Seems like it causes removing iterator too early, when calling ${loop.index} on the last element
the iterator is already removed.

Thanks.


&gt; LoopTool fails to retrieve $loop.index, $loop.first etc for the last element in a collection.
&gt; ---------------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELTOOLS-124
&gt;                 URL: https://issues.apache.org/jira/browse/VELTOOLS-124
&gt;             Project: Velocity Tools
&gt;          Issue Type: Bug
&gt;          Components: GenericTools
&gt;    Affects Versions: 2.x
&gt;         Environment: velocity-tools-2.0-beta4 with velocity-1.6.2
&gt;            Reporter: Sergiy Kovalchuk
&gt;             Fix For: 2.x
&gt;
&gt;
&gt; $loop.index, $loop.first and other LoopTool methods (that depend on iterator) return
null for the last element in a collection.
&gt; Try to run:
&gt; #set( $list = [1..3] )
&gt; #foreach($i in $loop.watch($list))
&gt; 	i[${loop.index}]=$i;
&gt; #end
&gt; The result is:
&gt; i[0]=1; i[1]=2; i[${loop.index}]=3; 
&gt; I tried to investigate it a little, and seems like the problem is  inside  "cacheNext(boolean
popWhenDone)".
&gt; First it checks if (!iterator.hasNext()) and if not then removes this iterator from the
stack. But later in this method it retrieves next element from a collection "this.next = iterator.next();".
Seems like it causes removing iterator too early, when calling ${loop.index} on the last element
the iterator is already removed.
&gt; Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [tools] Adding localization method to DateTool</title>
<author><name>Nathan Bubna &lt;nbubna@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c4d651da50911151224t213560fan96f51009c2b51e6e@mail.gmail.com%3e"/>
<id>urn:uuid:%3c4d651da50911151224t213560fan96f51009c2b51e6e@mail-gmail-com%3e</id>
<updated>2009-11-15T20:24:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Sun, Nov 15, 2009 at 7:26 AM, Christopher Schultz
&lt;chris@christopherschultz.net&gt; wrote:
&gt; Nathan,
&gt;
&gt; Resurrecting this because I'm ready to commit.
&gt;
&gt; On 10/29/2009 3:04 PM, Nathan Bubna wrote:
&gt;&gt; On Thu, Oct 29, 2009 at 8:06 AM, Christopher Schultz
&gt;&gt; &lt;chris@christopherschultz.net&gt; wrote:
&gt;&gt;&gt; Nathan,
&gt;&gt;&gt;
&gt;&gt;&gt; On 10/29/2009 11:02 AM, Christopher Schultz wrote:
&gt;&gt;&gt;&gt; I like re-coding into SimpleDataFormat better.
&gt;&gt;&gt;
&gt;&gt;&gt; D'oh: that's not possible because DateFormat doesn't expose the pattern
&gt;&gt;&gt; it's using, so I'll have to return something unrelated. Hmm. I'm not a
&gt;&gt;&gt; big fan of NULL but it's also not exactly consistent with the API if an
&gt;&gt;&gt; error message is returned.
&gt;&gt;&gt;
&gt;&gt;&gt; Any ideas other than NULL?
&gt;&gt;
&gt;&gt; Not really, because a) it's unlikely to ever occur in practice and b)
&gt;&gt; that's the traditional VelocityTools response to bad inputs.  If you
&gt;&gt; call $date.toLocalizedPattern($invalidInput) then that's little better
&gt;&gt; than $date.noSuchMethod($validinput).  Either way, part of the
&gt;&gt; reference is invalid, and we want to render it as an invalid
&gt;&gt; reference.  Returning null accomplishes that.
&gt;
&gt; While I agree that VelocityTools' traditional response to bad input is
&gt; null, the problem here isn't the user's bad input: instead, it's our
&gt; reliance on an unpublished but highly likely coincidence that DateFormat
&gt; always hands-out SimpleDateFormat objects.

ah, but i didn't mean to imply that it is *just* the standard response
to bad input.  it's the convention for all errors when attempting to
execute a tool method.  it tells the user there's a problem in a
consistent manner, responds to silent notation, is easily caught by an
event handler, and properly blows up when VelocityEngine is running in
the new strict mode.  returning an error string would be inconsistent
and fail to draw the attention of other facilities for error
checking/handling that Velocity provides.

&gt; For patterns other than "simple_date" and stuff like that, I could
&gt; simply construct a new SimpleDateFormat object and use that, but then
&gt; the behavior of toLocalizedPattern would differ from the other methods
&gt; -- that is, "short_date" would work, except when it doesn't :(

yeah, but i think that's acceptable.  do the best we can, return null
when nothing can be done.

&gt; Thanks,
&gt; -chris
&gt;
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: [tools] Adding localization method to DateTool</title>
<author><name>Christopher Schultz &lt;chris@christopherschultz.net&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c4B001DA8.50202@christopherschultz.net%3e"/>
<id>urn:uuid:%3c4B001DA8-50202@christopherschultz-net%3e</id>
<updated>2009-11-15T15:26:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Nathan,

Resurrecting this because I'm ready to commit.

On 10/29/2009 3:04 PM, Nathan Bubna wrote:
&gt; On Thu, Oct 29, 2009 at 8:06 AM, Christopher Schultz
&gt; &lt;chris@christopherschultz.net&gt; wrote:
&gt;&gt; Nathan,
&gt;&gt;
&gt;&gt; On 10/29/2009 11:02 AM, Christopher Schultz wrote:
&gt;&gt;&gt; I like re-coding into SimpleDataFormat better.
&gt;&gt;
&gt;&gt; D'oh: that's not possible because DateFormat doesn't expose the pattern
&gt;&gt; it's using, so I'll have to return something unrelated. Hmm. I'm not a
&gt;&gt; big fan of NULL but it's also not exactly consistent with the API if an
&gt;&gt; error message is returned.
&gt;&gt;
&gt;&gt; Any ideas other than NULL?
&gt; 
&gt; Not really, because a) it's unlikely to ever occur in practice and b)
&gt; that's the traditional VelocityTools response to bad inputs.  If you
&gt; call $date.toLocalizedPattern($invalidInput) then that's little better
&gt; than $date.noSuchMethod($validinput).  Either way, part of the
&gt; reference is invalid, and we want to render it as an invalid
&gt; reference.  Returning null accomplishes that.

While I agree that VelocityTools' traditional response to bad input is
null, the problem here isn't the user's bad input: instead, it's our
reliance on an unpublished but highly likely coincidence that DateFormat
always hands-out SimpleDateFormat objects.

For patterns other than "simple_date" and stuff like that, I could
simply construct a new SimpleDateFormat object and use that, but then
the behavior of toLocalizedPattern would differ from the other methods
-- that is, "short_date" would work, except when it doesn't :(

Thanks,
-chris



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-657) $velocityHasNext not working properly (returns true even if iterator does not have next value)</title>
<author><name>&quot;Michael Parmeley (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c990418053.1258123059590.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c990418053-1258123059590-JavaMail-jira@brutus%3e</id>
<updated>2009-11-13T14:37:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Michael Parmeley updated VELOCITY-657:
--------------------------------------

    Comment: was deleted

(was: I am using velocity 1.6.2 and this is still occuring. Using $velocityHasNext does not
work in nested loops.

For example:

I have: #foreach(${column} in ${columns})${column.columnName}#if(${velocityHasNext}),#end#end

However, if I have two columns named "foo" and "bar" this is resulting in "foobar". If I change
the condition in the if statment to something cheesy like (3 &gt; 2) then the expected results
of "foo,bar" is generated.

So the $velocityHasNext is still not working in velocity 1.6.2.

I have this property in my velocity.properties:

directive.foreach.iterator.name = velocityHasNext
)

&gt; $velocityHasNext not working properly (returns true even if iterator does not have next
value)
&gt; ----------------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-657
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-657
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6
&gt;            Reporter: Dominik Marks
&gt;            Priority: Minor
&gt;             Fix For: 1.6.2, 1.7
&gt;
&gt;         Attachments: velocity-657-testcase.patch
&gt;
&gt;
&gt; Using the new "velocityHasNext" feature in loops does not work as expected.
&gt; When using the following excerpt:
&gt; #foreach ($value in $element.values)
&gt;  $value 
&gt;  #if( $velocityHasNext )
&gt;   SEPARATOR
&gt;  #end
&gt; #end
&gt; and having $element.values as e.g. "test1", "test2", "test3"
&gt; I get
&gt; test1 SEPARATOR test2 SEPARATOR test3 SEPARATOR
&gt; but I would expect
&gt; test1 SEPARATOR test2 SEPARATOR test3
&gt; When looking into the source code, I see the following in org.apache.velocity.runtime.directive.Foreach.render():
&gt; while (!maxNbrLoopsExceeded &amp;&amp; i.hasNext())
&gt;         {
&gt;             // TODO: JDK 1.5+ -&gt; Integer.valueOf()
&gt;             put(context, counterName , new Integer(counter));
&gt;             put(context, hasNextName, Boolean.valueOf(i.hasNext()));
&gt;             Object value = i.next();
&gt;             put(context, elementKey, value);
&gt;       ....
&gt; }
&gt; Isn't this the wrong order of instructions?
&gt; I would expect:
&gt;             Object value = i.next();
&gt;             put(context, hasNextName, Boolean.valueOf(i.hasNext()));
&gt; So that the $velocityHasNext variable will be filled with the "hasNext" of the follow-up
iteration and not with the "hasNext" of the current iteration (which will always be true,
otherwise the loop has finished before).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELOCITY-657) $velocityHasNext not working properly (returns true even if iterator does not have next value)</title>
<author><name>&quot;Michael Parmeley (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1922049751.1258122939744.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1922049751-1258122939744-JavaMail-jira@brutus%3e</id>
<updated>2009-11-13T14:35:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELOCITY-657?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12777514#action_12777514
] 

Michael Parmeley commented on VELOCITY-657:
-------------------------------------------

I am using velocity 1.6.2 and this is still occuring. Using $velocityHasNext does not work
in nested loops.

For example:

I have: #foreach(${column} in ${columns})${column.columnName}#if(${velocityHasNext}),#end#end

However, if I have two columns named "foo" and "bar" this is resulting in "foobar". If I change
the condition in the if statment to something cheesy like (3 &gt; 2) then the expected results
of "foo,bar" is generated.

So the $velocityHasNext is still not working in velocity 1.6.2.

I have this property in my velocity.properties:

directive.foreach.iterator.name = velocityHasNext


&gt; $velocityHasNext not working properly (returns true even if iterator does not have next
value)
&gt; ----------------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-657
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-657
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6
&gt;            Reporter: Dominik Marks
&gt;            Priority: Minor
&gt;             Fix For: 1.6.2, 1.7
&gt;
&gt;         Attachments: velocity-657-testcase.patch
&gt;
&gt;
&gt; Using the new "velocityHasNext" feature in loops does not work as expected.
&gt; When using the following excerpt:
&gt; #foreach ($value in $element.values)
&gt;  $value 
&gt;  #if( $velocityHasNext )
&gt;   SEPARATOR
&gt;  #end
&gt; #end
&gt; and having $element.values as e.g. "test1", "test2", "test3"
&gt; I get
&gt; test1 SEPARATOR test2 SEPARATOR test3 SEPARATOR
&gt; but I would expect
&gt; test1 SEPARATOR test2 SEPARATOR test3
&gt; When looking into the source code, I see the following in org.apache.velocity.runtime.directive.Foreach.render():
&gt; while (!maxNbrLoopsExceeded &amp;&amp; i.hasNext())
&gt;         {
&gt;             // TODO: JDK 1.5+ -&gt; Integer.valueOf()
&gt;             put(context, counterName , new Integer(counter));
&gt;             put(context, hasNextName, Boolean.valueOf(i.hasNext()));
&gt;             Object value = i.next();
&gt;             put(context, elementKey, value);
&gt;       ....
&gt; }
&gt; Isn't this the wrong order of instructions?
&gt; I would expect:
&gt;             Object value = i.next();
&gt;             put(context, hasNextName, Boolean.valueOf(i.hasNext()));
&gt; So that the $velocityHasNext variable will be filled with the "hasNext" of the follow-up
iteration and not with the "hasNext" of the current iteration (which will always be true,
otherwise the loop has finished before).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (DBF-11) Update libraries version (FOP)</title>
<author><name>&quot;Alessandro Ruzzon (JIRA)&quot; &lt;jira@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c335766423.1258110759601.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c335766423-1258110759601-JavaMail-jira@brutus%3e</id>
<updated>2009-11-13T11:12:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Update libraries version (FOP)
------------------------------

                 Key: DBF-11
                 URL: https://issues.apache.org/jira/browse/DBF-11
             Project: DocBook Framework
          Issue Type: Bug
            Reporter: Alessandro Ruzzon


Can you create a binary version that could work with version 0.95 of Apache FOP? There is
a bug when you try to insert a rotated image (in which height is more than width), so I need
to solve it. It seems it's a bug of FOP, and actually the version supported is 0.20.5.

Thanks all

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>=?utf-8?q?=5BVelocity_Wiki=5D_Update_of_=22BoardReport-November2009=22_by?= =?utf-8?q?_HenningSchmiedehausen?=</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c20091112200103.28057.79554@eos.apache.org%3e"/>
<id>urn:uuid:%3c20091112200103-28057-79554@eos-apache-org%3e</id>
<updated>2009-11-12T20:01:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Velocity Wiki" for change notification.

The "BoardReport-November2009" page has been changed by HenningSchmiedehausen.
http://wiki.apache.org/velocity/BoardReport-November2009

--------------------------------------------------

New page:
== November 2009 Board Report ==

=== Status ===

Velocity still continues it quiet, steady flow. Activity picked up a little in October with
some messages on the dev list. The user lists continues to be very self-helping with questions
getting answered by members of the user and dev communities.

Velocity changed its chair from Will Glass-Husain to Henning Schmiedehausen.

The Velocity project currently has no board-level issues at this time.

There were new committers or PMC members voted in since the last board meeting.

No beta or final releases were made since the last board report.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>=?utf-8?q?=5BVelocity_Wiki=5D_Update_of_=22ASFBoardReports=22_by_HenningS?= =?utf-8?q?chmiedehausen?=</title>
<author><name>Apache Wiki &lt;wikidiffs@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c20091112183047.18649.3337@eos.apache.org%3e"/>
<id>urn:uuid:%3c20091112183047-18649-3337@eos-apache-org%3e</id>
<updated>2009-11-12T18:30:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Velocity Wiki" for change notification.

The "ASFBoardReports" page has been changed by HenningSchmiedehausen.
http://wiki.apache.org/velocity/ASFBoardReports?action=diff&amp;rev1=1&amp;rev2=2

--------------------------------------------------

   * [[BoardReport-February2009]]
   * [[BoardReport-May2009]]
   * [[BoardReport-October2009]]
+  * [[BoardReport-November2009]]
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-743) The character  &quot;:&quot; if present within the curly braces of a variable throws exception</title>
<author><name>&quot;Nathan Bubna (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1520202449.1257793892619.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1520202449-1257793892619-JavaMail-jira@brutus%3e</id>
<updated>2009-11-09T19:11:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nathan Bubna updated VELOCITY-743:
----------------------------------

    Component/s: Engine
       Priority: Minor  (was: Major)
     Issue Type: Improvement  (was: Bug)

Sorry, this is intentional.  The colon is not a supported character in references.   It will
certainly never be considered a valid reference character for standard $reference notation.

I'll leave this open as an RFE though, since i suppose it would be possible to increase the
scope of legal reference characters in formal ${reference} notation.

For now, your best bet is probably to add the context to itself:

context.put("ctx", context);

and then do $ctx.get("EPL_JOBTITLE:varB_EPL") to give yourself more character freedom.

&gt; The character  ":" if present within the curly braces of a variable throws exception
&gt; ------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-743
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-743
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;         Environment: JRE 6, Apache tomcat 6.0.18
&gt;            Reporter: Vinay
&gt;            Priority: Minor
&gt;
&gt; I am trying to write a template that is customized like this
&gt; -----------------------------------------------------------------------------
&gt; &lt;hi&gt;
&gt; &lt;variable1&gt; ${EPL_JOBTITLE:varB_EPL} &lt;/variable1&gt;
&gt; &lt;variable2&gt;${SPL_EMPLOYEENUMBER:varA_SPL} &lt;/variable2&gt;
&gt; &lt;/hi&gt;
&gt; -----------------------------------------------------------------------------
&gt; Now the ${EPL_JOBTITLE:varB_EPL} is custom parsed and replaced with the appropriate values
in the context.
&gt; However, as soon as the Template is loaded by the velocity engine I get a 
&gt; Template Parse Exception : 
&gt; Encountered ":varB_EPL}\r\n\r\n\r\n" at MY Script - 1\Test this.vm[line 1, column 15]
&gt; Was expecting one of:
&gt;     "}" ...
&gt;     &lt;DOT&gt; ...
&gt; How is the ":" character an invalid one within braces ? Shouldn't it be supported within
a variable name?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELOCITY-743) The character  &quot;:&quot; if present within the curly braces of a variable throws exception</title>
<author><name>&quot;Vinay (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c2070291794.1257793052503.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c2070291794-1257793052503-JavaMail-jira@brutus%3e</id>
<updated>2009-11-09T18:57:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The character  ":" if present within the curly braces of a variable throws exception
------------------------------------------------------------------------------------

                 Key: VELOCITY-743
                 URL: https://issues.apache.org/jira/browse/VELOCITY-743
             Project: Velocity
          Issue Type: Bug
    Affects Versions: 1.6.2
         Environment: JRE 6, Apache tomcat 6.0.18
            Reporter: Vinay


I am trying to write a template that is customized like this
-----------------------------------------------------------------------------
&lt;hi&gt;
&lt;variable1&gt; ${EPL_JOBTITLE:varB_EPL} &lt;/variable1&gt;
&lt;variable2&gt;${SPL_EMPLOYEENUMBER:varA_SPL} &lt;/variable2&gt;
&lt;/hi&gt;
-----------------------------------------------------------------------------

Now the ${EPL_JOBTITLE:varB_EPL} is custom parsed and replaced with the appropriate values
in the context.
However, as soon as the Template is loaded by the velocity engine I get a 

Template Parse Exception : 
Encountered ":varB_EPL}\r\n\r\n\r\n" at MY Script - 1\Test this.vm[line 1, column 15]
Was expecting one of:
    "}" ...
    &lt;DOT&gt; ...


How is the ":" character an invalid one within braces ? Shouldn't it be supported within a
variable name?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Created: (VELOCITY-742) Easily Add/Remove/Replace Directives Without Cracking Open Velocity Jar</title>
<author><name>&quot;Tim White (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c66024775.1257517232488.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c66024775-1257517232488-JavaMail-jira@brutus%3e</id>
<updated>2009-11-06T14:20:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Easily Add/Remove/Replace Directives Without Cracking Open Velocity Jar
-----------------------------------------------------------------------

                 Key: VELOCITY-742
                 URL: https://issues.apache.org/jira/browse/VELOCITY-742
             Project: Velocity
          Issue Type: New Feature
          Components: Engine
    Affects Versions: 1.6.2
            Reporter: Tim White
            Priority: Minor


There are two use cases that I have for this issue:

1) We need to turn off #include in order to parse .html files that include SSI directives:
 &lt;!--#include virtual=""--&gt;  (we always use #parse in our world, so no loss for #include
going away)

2) We need to supply our own version of #parse that contains the development hooks that I
described in a different issue.

Right now, the only crisp way to do is is to crack open the velocity .jar and make these changes,
which is very risky, because future developers may upgrade to new versions of Velocity and
not realize that there are customizations and/or not understand how to remake them....not
to mention in a shared-classpath environment, we don't always have control over which copy
of the Velocity .jar we're using.

Ideally, there would be config options like this:

directive_remove ("#parse", "#include")
directive_add ("#parse", "com.qwest.velocity.directives.Parse")

Thanks!

Tim

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELOCITY-736) Introspection regression from 1.5 to 1.6.2</title>
<author><name>&quot;David Esposito (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c2033429979.1257343052657.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c2033429979-1257343052657-JavaMail-jira@brutus%3e</id>
<updated>2009-11-04T13:57:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELOCITY-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12773486#action_12773486
] 

David Esposito commented on VELOCITY-736:
-----------------------------------------

Hi Guys,

I was hoping for a resolution one way or the other on this. If it's not going to be "fixed",
I will need to work around it ... If it is, when could I expect the fix to be included?

Nathan, addressing the detail of "public methods declared in public classes" ... Why isn't
it as simple as "public methods"? .. Why does the protection of the class have any relevance?
From an end-user perspective, I would expect that I can invoke any 'getter' that I can from
my Java code regardless of the inheritance scheme of the class ... In this case, I have the
Javadocs and source code of the Commons-Fileupload classes to understand what the developers
intended, but if it's a closed source library I'm using, I would have to decompile the binaries
to figure out why my methods aren't being invoke from VTL.

-Dave

&gt; Introspection regression from 1.5 to 1.6.2
&gt; ------------------------------------------
&gt;
&gt;                 Key: VELOCITY-736
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-736
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;         Environment: Sun JDK 1.6.0_16
&gt;            Reporter: David Esposito
&gt;         Attachments: Velocity736TestCase.java
&gt;
&gt;
&gt; When upgrading from Velcocity 1.5 to 1.6.2, the following snippet of code changed behavior.

&gt; In Velocity 1.5, the output was:
&gt; The file upload exceeded 100
&gt; In Velocity 1.6.2, the output is:
&gt; The file upload exceeded $ex.permittedSize
&gt; There is nothing in the velocity log file to help me identify why it's not resolving
'permittedSize' to the correct bean method.
&gt; Here is a test program to replicate the problem. The context variable in question is
the Commons FileUpload exception class documented here:
&gt; http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileUploadBase.SizeLimitExceededException.html
&gt; I am using commons-fileupload-1.2.jar
&gt; import java.io.StringWriter;
&gt; import org.apache.commons.fileupload.FileUploadBase;
&gt; import org.apache.velocity.VelocityContext;
&gt; import org.apache.velocity.app.VelocityEngine;
&gt; import org.apache.velocity.context.Context;
&gt; public class Main {
&gt;     public static void main(String[] args) throws Exception{
&gt;         VelocityEngine e = new VelocityEngine();
&gt; 		String testTemplate = "The file upload exceeded $ex.permittedSize";
&gt; 		StringWriter out = new StringWriter();
&gt; 		Context ctx = new VelocityContext();
&gt; 		FileUploadBase.FileSizeLimitExceededException ex = new FileUploadBase.FileSizeLimitExceededException("too
big!", 50, 100);
&gt; 		ctx.put("ex",ex);
&gt; 		e.evaluate(ctx, out, "Tester", testTemplate);
&gt; 		System.out.println(out.toString());
&gt;     }
&gt; }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELOCITY-715) Leaked object in FileResourceLoader#templatePaths</title>
<author><name>&quot;Byron Foster (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c455754658.1257300812409.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c455754658-1257300812409-JavaMail-jira@brutus%3e</id>
<updated>2009-11-04T02:13:32Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELOCITY-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12773349#action_12773349
] 

Byron Foster commented on VELOCITY-715:
---------------------------------------

The WeakHashMap will correctly drop the value when the key is gargage collected, but as your
link points out the WeakHashMap is not a cache.  JVM behavior will differ, but in general
key/value pairs will be dropped for every garbage sweep, which mean allot of rebuilding of
templates.  Also, as you point out, this is only an issue with many 10s of thousands of file
names...  I can't imagine a use case where this is a practical concern.

I don't see a bug here..


&gt; Leaked object in FileResourceLoader#templatePaths
&gt; -------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-715
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-715
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;            Reporter: Atsushi Isobe
&gt;            Priority: Minor
&gt;         Attachments: FileResourceLoader.patch, FileResourceLoaderLeakedObjectTest.java
&gt;
&gt;
&gt;  org.apache.velocity.runtime.resource.loader.FileResourceLoader#templatePaths has stored
templatename and real file path permanently.So if VelocityEngine#getTemplate(String) has called
by too many files, #templatePaths have been enlarged. 
&gt; Bellow my test results.
&gt; ----------------------------------------
&gt; 2009-05-08 19:16:54,571 INFO  [FileResourceLoaderLeakedObjectTest] count: 000,000 total:
002,696,488
&gt; 2009-05-08 19:19:23,381 INFO  [FileResourceLoaderLeakedObjectTest] count: 065,536 total:
014,689,896
&gt; 2009-05-08 19:22:03,782 INFO  [FileResourceLoaderLeakedObjectTest] count: 131,072 total:
025,374,944
&gt; 2009-05-08 19:24:14,756 INFO  [FileResourceLoaderLeakedObjectTest] count: 196,608 total:
036,282,696
&gt; 2009-05-08 19:26:37,864 INFO  [FileResourceLoaderLeakedObjectTest] count: 262,144 total:
046,776,168
&gt; 2009-05-08 19:28:55,090 INFO  [FileResourceLoaderLeakedObjectTest] count: 327,680 total:
057,119,560
&gt; 2009-05-08 19:31:37,524 INFO  [FileResourceLoaderLeakedObjectTest] count: 393,216 total:
069,858,824
&gt; 2009-05-08 19:34:10,425 INFO  [FileResourceLoaderLeakedObjectTest] count: 458,752 total:
080,019,920
&gt; 2009-05-08 19:36:52,788 INFO  [FileResourceLoaderLeakedObjectTest] count: 524,288 total:
090,093,168
&gt; 2009-05-08 19:39:13,662 INFO  [FileResourceLoaderLeakedObjectTest] count: 589,824 total:
097,385,776
&gt; 2009-05-08 19:41:54,621 INFO  [FileResourceLoaderLeakedObjectTest] count: 655,360 total:
107,387,792
&gt; 2009-05-08 19:44:31,601 INFO  [FileResourceLoaderLeakedObjectTest] count: 720,896 total:
117,451,912
&gt; 2009-05-08 19:47:08,890 INFO  [FileResourceLoaderLeakedObjectTest] count: 786,432 total:
137,151,792
&gt; 2009-05-08 19:49:44,924 INFO  [FileResourceLoaderLeakedObjectTest] count: 851,968 total:
147,277,856

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (VELOCITY-740) InvalidReferenceEventHandler should get indication that a reference is quiet</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1520953558.1257226439634.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1520953558-1257226439634-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T05:33:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-740?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain resolved VELOCITY-740.
----------------------------------------

    Resolution: Fixed

Done.  Now passes $!foo instead of $foo to InvalidReferenceHandler upon hitting an invalid
silent reference.

&gt; InvalidReferenceEventHandler should get indication that a reference is quiet
&gt; ----------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-740
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-740
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;            Reporter: Will Glass-Husain
&gt;             Fix For: 1.7
&gt;
&gt;
&gt; Right now the InvalidReferenceEventHandler is called for bad references whether they
are quiet or not.  The reference is passed as "$abc" even if the template actually contains
"$!abc".
&gt; Typically, you'd want to ignore invalid references.  We should fix this to pass "$!abc"
instead of $abc.
&gt; It's not a hard fix -- anyone mind if I change this?  Technically, it's a break in backwards
compatibility but a pretty minor one.  It will still get called but with an indication the
reference is quiet.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (VELOCITY-586) Add debugging hooks to #parse</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1167967007.1257217799385.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1167967007-1257217799385-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T03:09:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain resolved VELOCITY-586.
----------------------------------------

    Resolution: Won't Fix

Thanks for sharing this.

Going to resolve this issue - I think we don't want to mix HTTP and #parse. But it's a good
custom directive if you need it.

An alternate way of doing this is to use IncludeEventHandler to redirect to a "wrapper" page
which includes this kind of info.  

&gt; Add debugging hooks to #parse
&gt; -----------------------------
&gt;
&gt;                 Key: VELOCITY-586
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-586
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;    Affects Versions: 1.5
&gt;            Reporter: Tim White
&gt;            Priority: Minor
&gt;
&gt; When you have a page that is made up of a complex web of templates and #parsed includes,
it is critical to be able to quickly see what parts of the page are really in what file.
&gt; To do this, I've hacked #parse to inject debugging information into the template when
a 'debug mode' is engaged.  This debug mode is engaged via a URL parameter.
&gt; I also inject this information in the VVS right before the main template is rendered.
 In this way, you can create a debug overlay on top of the page in your browser that shows
you where each piece of text is coming from.
&gt; I think this probably could better be implemented using hooks, so that a user could trigger
when the debug information was being injected.
&gt; I also suggest that the name of the current template, it's resource loader, etc. be passed
into the context, so it can be used to see what template is where and what loader it came
from.
&gt; Finally, if there could be a way to conditionally prepend or append a template to each
merged or #parse template, that could also help.
&gt; Thanks!!!
&gt; package org.apache.velocity.runtime.directive;
&gt; /*
&gt;  * Licensed to the Apache Software Foundation (ASF) under one
&gt;  * or more contributor license agreements.  See the NOTICE file
&gt;  * distributed with this work for additional information
&gt;  * regarding copyright ownership.  The ASF licenses this file
&gt;  * to you under the Apache License, Version 2.0 (the
&gt;  * "License"); you may not use this file except in compliance
&gt;  * with the License.  You may obtain a copy of the License at
&gt;  *
&gt;  *   http://www.apache.org/licenses/LICENSE-2.0
&gt;  *
&gt;  * Unless required by applicable law or agreed to in writing,
&gt;  * software distributed under the License is distributed on an
&gt;  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
&gt;  * KIND, either express or implied.  See the License for the
&gt;  * specific language governing permissions and limitations
&gt;  * under the License.    
&gt;  */
&gt; import java.io.IOException;
&gt; import java.io.Writer;
&gt; import javax.servlet.http.HttpSession;
&gt; import org.apache.velocity.Template;
&gt; import org.apache.velocity.app.event.EventHandlerUtil;
&gt; import org.apache.velocity.context.InternalContextAdapter;
&gt; import org.apache.velocity.exception.MethodInvocationException;
&gt; import org.apache.velocity.exception.ParseErrorException;
&gt; import org.apache.velocity.exception.ResourceNotFoundException;
&gt; import org.apache.velocity.runtime.RuntimeConstants;
&gt; import org.apache.velocity.runtime.parser.node.Node;
&gt; import org.apache.velocity.runtime.parser.node.SimpleNode;
&gt; import com.qwest.velocity.VelocityConstants;
&gt; /**
&gt;  * Pluggable directive that handles the &lt;code&gt;#parse()&lt;/code&gt; statement in
VTL.
&gt;  * 
&gt;  * &lt;pre&gt;
&gt;  *  Notes:
&gt;  *  -----
&gt;  *   1) The parsed source material can only come from somewhere in
&gt;  *     the TemplateRoot tree for security reasons. There is no way
&gt;  *     around this.  If you want to include content from elsewhere on
&gt;  *     your disk, use a link from somwhere under Template Root to that
&gt;  *     content.
&gt;  * 
&gt;  *   2) There is a limited parse depth.  It is set as a property
&gt;  *     &amp;quot;parse_directive.maxdepth = 10&amp;quot;  for example.  There is a 20
iteration
&gt;  *     safety in the event that the parameter isn't set.
&gt;  * &lt;/pre&gt;
&gt;  * 
&gt;  * @author &lt;a href="mailto:geirm@optonline.net"&gt;Geir Magnusson Jr.&lt;/a&gt;
&gt;  * @author &lt;a href="mailto:jvanzyl@apache.org"&gt;Jason van Zyl&lt;/a&gt;
&gt;  * @author &lt;a href="mailto:Christoph.Reck@dlr.de"&gt;Christoph Reck&lt;/a&gt;
&gt;  * @version $Id: Parse.java 463298 2006-10-12 16:10:32Z henning $
&gt;  */
&gt; public class Parse extends InputBase {
&gt; 	/**
&gt; 	 * Return name of this directive.
&gt; 	 * 
&gt; 	 * @return The name of this directive.
&gt; 	 */
&gt; 	public String getName() {
&gt; 		return "parse";
&gt; 	}
&gt; 	/**
&gt; 	 * Return type of this directive.
&gt; 	 * 
&gt; 	 * @return The type of this directive.
&gt; 	 */
&gt; 	public int getType() {
&gt; 		return LINE;
&gt; 	}
&gt; 	/**
&gt; 	 * iterates through the argument list and renders every argument that is appropriate.
Any non appropriate arguments are logged, but render() continues.
&gt; 	 * 
&gt; 	 * @param context
&gt; 	 * @param writer
&gt; 	 * @param node
&gt; 	 * @return True if the directive rendered successfully.
&gt; 	 * @throws IOException
&gt; 	 * @throws ResourceNotFoundException
&gt; 	 * @throws ParseErrorException
&gt; 	 * @throws MethodInvocationException
&gt; 	 */
&gt; 	public boolean render(InternalContextAdapter context, Writer writer, Node node) throws
IOException, ResourceNotFoundException, ParseErrorException, MethodInvocationException {
&gt; 		/*
&gt; 		 * if rendering is no longer allowed (after a stop), we can safely skip execution of
all the parse directives.
&gt; 		 */
&gt; 		if (!context.getAllowRendering()) {
&gt; 			return true;
&gt; 		}
&gt; 		/*
&gt; 		 * did we get an argument?
&gt; 		 */
&gt; 		if (node.jjtGetChild(0) == null) {
&gt; 			rsvc.getLog().error("Portal #parse() null argument");
&gt; 			return false;
&gt; 		}
&gt; 		/*
&gt; 		 * does it have a value? If you have a null reference, then no.
&gt; 		 */
&gt; 		Object value = node.jjtGetChild(0).value(context);
&gt; 		if (value == null) {
&gt; 			rsvc.getLog().error("Portal #parse() null argument");
&gt; 			return false;
&gt; 		}
&gt; 		/*
&gt; 		 * get the path
&gt; 		 */
&gt; 		String sourcearg = value.toString();
&gt; 		/*
&gt; 		 * check to see if the argument will be changed by the event cartridge
&gt; 		 */
&gt; 		String arg = EventHandlerUtil.includeEvent(rsvc, context, sourcearg, context.getCurrentTemplateName(),
getName());
&gt; 		/*
&gt; 		 * a null return value from the event cartridge indicates we should not input a resource.
&gt; 		 */
&gt; 		boolean blockinput = false;
&gt; 		if (arg == null)
&gt; 			blockinput = true;
&gt; 		/*
&gt; 		 * see if we have exceeded the configured depth. If it isn't configured, put a stop
at 20 just in case.
&gt; 		 */
&gt; 		Object[] templateStack = context.getTemplateNameStack();
&gt; 		if (templateStack.length &gt;= rsvc.getInt(RuntimeConstants.PARSE_DIRECTIVE_MAXDEPTH,
20)) {
&gt; 			StringBuffer path = new StringBuffer();
&gt; 			for (int i = 0; i &lt; templateStack.length; ++i) {
&gt; 				path.append(" &gt; " + templateStack[i]);
&gt; 			}
&gt; 			rsvc.getLog().error("Portal #parse: Max recursion depth reached (" + templateStack.length
+ ')' + " File stack:" + path);
&gt; 			return false;
&gt; 		}
&gt; 		/*
&gt; 		 * now use the Runtime resource loader to get the template
&gt; 		 */
&gt; 		Template t = null;
&gt; 		try {
&gt; 			if (!blockinput)
&gt; 				t = rsvc.getTemplate(arg, getInputEncoding(context));
&gt; 		} catch (ResourceNotFoundException rnfe) {
&gt; 			/*
&gt; 			 * the arg wasn't found. Note it and throw
&gt; 			 */
&gt; 			rsvc.getLog().error("Portal #parse(): cannot find template '" + arg + "', called from
template " + context.getCurrentTemplateName() + " at (" + getLine() + ", " + getColumn() +
")");
&gt; 			throw rnfe;
&gt; 		} catch (ParseErrorException pee) {
&gt; 			/*
&gt; 			 * the arg was found, but didn't parse - syntax error note it and throw
&gt; 			 */
&gt; 			rsvc.getLog().error(
&gt; 					"Portal #parse(): syntax error in #parse()-ed template '" + arg + "', called from
template " + context.getCurrentTemplateName() + " at (" + getLine() + ", " + getColumn() +
")");
&gt; 			throw pee;
&gt; 		}
&gt; 		/**
&gt; 		 * pass through application level runtime exceptions
&gt; 		 */
&gt; 		catch (RuntimeException e) {
&gt; 			throw e;
&gt; 		} catch (Exception e) {
&gt; 			rsvc.getLog().error("Portal #parse() : arg = " + arg + '.', e);
&gt; 			return false;
&gt; 		}
&gt; 		/*
&gt; 		 * and render it
&gt; 		 */
&gt; 		try {
&gt; 			if (rsvc.getLog().isDebugEnabled()) {
&gt; 				rsvc.getLog().debug("*** Portal #Parse Template Path: " + t.getName());
&gt; 			}
&gt; 			
&gt; 			/* Save the name of the main template before resetting templateName for this include
*/
&gt; 			String mainTemplateName = "";
&gt; 			if (context.get(VelocityConstants.TEMPLATE_NAME_VAR) != null) {
&gt; 				mainTemplateName = context.get(VelocityConstants.TEMPLATE_NAME_VAR).toString();
&gt; 			}
&gt; 			/* Set the name of the current template in the context for general use */
&gt; 			context.put(VelocityConstants.TEMPLATE_NAME_VAR, t.getName());
&gt; 			/* Check various places to see if debug mode is enabled */
&gt; 			boolean debugMode = false;
&gt; 			/* This supports PortalVelocityViewServlet */
&gt; 			if (context.get(VelocityConstants.DEBUG_ATTRIBUTE) != null) {
&gt; 				debugMode = true;
&gt; 			}
&gt; 			/* This supports qcms.getMessage() */
&gt; 			if (context.get("session") != null) {
&gt; 				HttpSession session = (HttpSession) context.get("session");
&gt; 				if (session.getAttribute("qCmsDebugger") != null) {
&gt; 					debugMode = true;
&gt; 				}
&gt; 			}
&gt; 			/* Print Debug start output to browser if debug mode is on */
&gt; 			if (debugMode) {
&gt; 				Template startTemplate = rsvc.getTemplate(VelocityConstants.DEBUG_OUTLINE_START_TEMPLATE,
getInputEncoding(context));
&gt; 				startTemplate.merge(context, writer);
&gt; 				Template nameTemplate = rsvc.getTemplate(VelocityConstants.DEBUG_NAME_TEMPLATE, getInputEncoding(context));
&gt; 				nameTemplate.merge(context, writer);
&gt; 			}
&gt; 			
&gt; 			if (!blockinput) {
&gt; 				context.pushCurrentTemplateName(arg);
&gt; 				((SimpleNode) t.getData()).render(context, writer);
&gt; 			}
&gt; 			
&gt; 			/* Print Debug end output to browser if debug mode is on */
&gt; 			if (debugMode) {
&gt; 				Template endTemplate = rsvc.getTemplate(VelocityConstants.DEBUG_OUTLINE_END_TEMPLATE,
getInputEncoding(context));
&gt; 				endTemplate.merge(context, writer);
&gt; 			}
&gt; 			/* Restore the templateName variable to match the main template name */
&gt; 			context.put(VelocityConstants.TEMPLATE_NAME_VAR, mainTemplateName);
&gt; 		}
&gt; 		/*
&gt; 		 * if it's a MIE, it came from the render.... throw it...
&gt; 		 */
&gt; 		catch (MethodInvocationException e) {
&gt; 			throw e;
&gt; 		}
&gt; 		/**
&gt; 		 * pass through application level runtime exceptions
&gt; 		 */
&gt; 		catch (RuntimeException e) {
&gt; 			throw e;
&gt; 		}
&gt; 		catch (Exception e) {
&gt; 			rsvc.getLog().error("Portal #parse: Exception rendering #parse(" + arg + ')', e);
&gt; 			return false;
&gt; 		} finally {
&gt; 			if (!blockinput)
&gt; 				context.popCurrentTemplateName();
&gt; 		}
&gt; 		/*
&gt; 		 * note - a blocked input is still a successful operation as this is expected behavior.
&gt; 		 */
&gt; 		return true;
&gt; 	}
&gt; }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-715) Leaked object in FileResourceLoader#templatePaths</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1082409423.1257217560678.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1082409423-1257217560678-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T03:06:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain updated VELOCITY-715:
---------------------------------------

    Fix Version/s:     (was: 1.7)

&gt; Leaked object in FileResourceLoader#templatePaths
&gt; -------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-715
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-715
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;            Reporter: Atsushi Isobe
&gt;            Priority: Minor
&gt;         Attachments: FileResourceLoader.patch, FileResourceLoaderLeakedObjectTest.java
&gt;
&gt;
&gt;  org.apache.velocity.runtime.resource.loader.FileResourceLoader#templatePaths has stored
templatename and real file path permanently.So if VelocityEngine#getTemplate(String) has called
by too many files, #templatePaths have been enlarged. 
&gt; Bellow my test results.
&gt; ----------------------------------------
&gt; 2009-05-08 19:16:54,571 INFO  [FileResourceLoaderLeakedObjectTest] count: 000,000 total:
002,696,488
&gt; 2009-05-08 19:19:23,381 INFO  [FileResourceLoaderLeakedObjectTest] count: 065,536 total:
014,689,896
&gt; 2009-05-08 19:22:03,782 INFO  [FileResourceLoaderLeakedObjectTest] count: 131,072 total:
025,374,944
&gt; 2009-05-08 19:24:14,756 INFO  [FileResourceLoaderLeakedObjectTest] count: 196,608 total:
036,282,696
&gt; 2009-05-08 19:26:37,864 INFO  [FileResourceLoaderLeakedObjectTest] count: 262,144 total:
046,776,168
&gt; 2009-05-08 19:28:55,090 INFO  [FileResourceLoaderLeakedObjectTest] count: 327,680 total:
057,119,560
&gt; 2009-05-08 19:31:37,524 INFO  [FileResourceLoaderLeakedObjectTest] count: 393,216 total:
069,858,824
&gt; 2009-05-08 19:34:10,425 INFO  [FileResourceLoaderLeakedObjectTest] count: 458,752 total:
080,019,920
&gt; 2009-05-08 19:36:52,788 INFO  [FileResourceLoaderLeakedObjectTest] count: 524,288 total:
090,093,168
&gt; 2009-05-08 19:39:13,662 INFO  [FileResourceLoaderLeakedObjectTest] count: 589,824 total:
097,385,776
&gt; 2009-05-08 19:41:54,621 INFO  [FileResourceLoaderLeakedObjectTest] count: 655,360 total:
107,387,792
&gt; 2009-05-08 19:44:31,601 INFO  [FileResourceLoaderLeakedObjectTest] count: 720,896 total:
117,451,912
&gt; 2009-05-08 19:47:08,890 INFO  [FileResourceLoaderLeakedObjectTest] count: 786,432 total:
137,151,792
&gt; 2009-05-08 19:49:44,924 INFO  [FileResourceLoaderLeakedObjectTest] count: 851,968 total:
147,277,856

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELOCITY-715) Leaked object in FileResourceLoader#templatePaths</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1661221414.1257217559384.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1661221414-1257217559384-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T03:05:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELOCITY-715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12772855#action_12772855
] 

Will Glass-Husain commented on VELOCITY-715:
--------------------------------------------

Thanks for sharing this.

This isn't a use case I've encountered.  These are all unique file names, right?  Your test
is assuming hundreds of thousands of different file names.  Most sites I've seen have a much
smaller number of template names.

I'm also concerned about the use of a WeakHashMap.  I'm not super experienced with this, but
doesn't this remove the key but not the value?  I'm concerned this may still leave the reference.

http://www.codeinstructions.com/2008/09/weakhashmap-is-not-cache-understanding.html

&gt; Leaked object in FileResourceLoader#templatePaths
&gt; -------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-715
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-715
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;            Reporter: Atsushi Isobe
&gt;            Priority: Minor
&gt;         Attachments: FileResourceLoader.patch, FileResourceLoaderLeakedObjectTest.java
&gt;
&gt;
&gt;  org.apache.velocity.runtime.resource.loader.FileResourceLoader#templatePaths has stored
templatename and real file path permanently.So if VelocityEngine#getTemplate(String) has called
by too many files, #templatePaths have been enlarged. 
&gt; Bellow my test results.
&gt; ----------------------------------------
&gt; 2009-05-08 19:16:54,571 INFO  [FileResourceLoaderLeakedObjectTest] count: 000,000 total:
002,696,488
&gt; 2009-05-08 19:19:23,381 INFO  [FileResourceLoaderLeakedObjectTest] count: 065,536 total:
014,689,896
&gt; 2009-05-08 19:22:03,782 INFO  [FileResourceLoaderLeakedObjectTest] count: 131,072 total:
025,374,944
&gt; 2009-05-08 19:24:14,756 INFO  [FileResourceLoaderLeakedObjectTest] count: 196,608 total:
036,282,696
&gt; 2009-05-08 19:26:37,864 INFO  [FileResourceLoaderLeakedObjectTest] count: 262,144 total:
046,776,168
&gt; 2009-05-08 19:28:55,090 INFO  [FileResourceLoaderLeakedObjectTest] count: 327,680 total:
057,119,560
&gt; 2009-05-08 19:31:37,524 INFO  [FileResourceLoaderLeakedObjectTest] count: 393,216 total:
069,858,824
&gt; 2009-05-08 19:34:10,425 INFO  [FileResourceLoaderLeakedObjectTest] count: 458,752 total:
080,019,920
&gt; 2009-05-08 19:36:52,788 INFO  [FileResourceLoaderLeakedObjectTest] count: 524,288 total:
090,093,168
&gt; 2009-05-08 19:39:13,662 INFO  [FileResourceLoaderLeakedObjectTest] count: 589,824 total:
097,385,776
&gt; 2009-05-08 19:41:54,621 INFO  [FileResourceLoaderLeakedObjectTest] count: 655,360 total:
107,387,792
&gt; 2009-05-08 19:44:31,601 INFO  [FileResourceLoaderLeakedObjectTest] count: 720,896 total:
117,451,912
&gt; 2009-05-08 19:47:08,890 INFO  [FileResourceLoaderLeakedObjectTest] count: 786,432 total:
137,151,792
&gt; 2009-05-08 19:49:44,924 INFO  [FileResourceLoaderLeakedObjectTest] count: 851,968 total:
147,277,856

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (VELOCITY-738) It would be useful to know that the error is occurred in which context.</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1058309136.1257216959704.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1058309136-1257216959704-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:55:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-738?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain resolved VELOCITY-738.
----------------------------------------

    Resolution: Won't Fix

If you catch the ParseException, it contains properties for the template name, line, and column
number,

&gt; It would be useful to know that the error is occurred in which context.
&gt; -----------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-738
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-738
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;            Reporter: Siri C.
&gt;
&gt; It would be better, if an error message display surroundings of the place where the error
is. 
&gt; For example: 
&gt; To display that an "(" character is illegal (there are hundreds of those characters in
a template)
&gt; but it would be useful to know that this character occurred in the context "product.getName()".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Commented: (VELOCITY-739) Do not throw exception for quiet references in strict reference checking mode</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c2041512023.1257216839386.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c2041512023-1257216839386-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:53:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

    [ https://issues.apache.org/jira/browse/VELOCITY-739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12772850#action_12772850
] 

Will Glass-Husain commented on VELOCITY-739:
--------------------------------------------


In the interests of conservatism, I'm going to leave this alone.    If more people want it
speak up.

&gt; Do not throw exception for quiet references in strict reference checking mode
&gt; -----------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-739
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-739
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;            Reporter: Will Glass-Husain
&gt;
&gt; I used strict reference checking for the first time and discovered that it throws exceptions
even for quiet references.
&gt; &lt;input class="signupInput" type="text" id="StxtFirstNames"
&gt; name="firstName" value="$!user.firstName"/&gt;
&gt; org.apache.velocity.exception.MethodInvocationException: Variable
&gt; $user has not been set at layout/slide_login.vm[line 13, column 117]
&gt; This doesn't make sense to me.  If a template author designates a reference as quiet,
it's explicitly not an error.  We're preventing the use of this convenient feature.
&gt; It's not a hard change to fix this.  Does it break backwards compatibility if we change
this?
&gt; Incidentally, there's an identical problem for InvalidReferenceEventHandler.  I'll file
a separate issue.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (VELOCITY-720) Suppress startup error message if macro library not found</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1936994434.1257216599599.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1936994434-1257216599599-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:49:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain resolved VELOCITY-720.
----------------------------------------

    Resolution: Fixed

I changed the Resource Loader code to omit the stack trace for a resource not found.  It seems
overkill.  (and rather frightening).   It still logs the message, in this case: cannot find
resource VM_global_library.vm.

&gt; Suppress startup error message if macro library not found
&gt; ---------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-720
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-720
&gt;             Project: Velocity
&gt;          Issue Type: Improvement
&gt;          Components: Engine
&gt;            Reporter: Will Glass-Husain
&gt;            Priority: Minor
&gt;             Fix For: 1.7
&gt;
&gt;
&gt; Ever since upgrading to Velocity 1.6.2 I get a stack trace when starting up due to a
missing macro library.  The stack trace in particular makes for a very noisy log.  I suggest
we do not print a stacktrace for a missing macro library at startup.
&gt;  Here's my settings
&gt;        VelocityEngine ve = new VelocityEngine();
&gt;        ve.setProperty("resource.loader", "class");
&gt;        ve.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
&gt;        ve.setProperty("class.resource.loader.cache", "false");
&gt;        ve.setProperty("runtime.Log.invalid.references ", "false");
&gt;        ve.setProperty("resource.manager.logwhenfound", "false");
&gt;        ve.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
&gt;        ve.setProperty("runtime.log.logsystem.log4j.category", "com.forio.Velocity");
&gt; And here's the log report
&gt; 2009-05-26 23:46:58 DEBUG Velocimacro : "velocimacro.library" is not set.  Trying default
library: VM_global_library.vm
&gt; 2009-05-26 23:46:58 DEBUG Could not load resource 'VM_global_library.vm' from ResourceLoader
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader:
&gt; 2009-05-26 23:46:58 DEBUG
&gt; org.apache.velocity.exception.ResourceNotFoundException:
&gt; ClasspathResourceLoader Error: cannot find resource VM_global_library.vm
&gt;        at org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader.getResourceStream(ClasspathResourceLoader.java:131)
&gt;        at org.apache.velocity.runtime.resource.loader.ResourceLoader.resourceExists(ResourceLoader.java:224)
&gt;        at org.apache.velocity.runtime.resource.ResourceManagerImpl.getLoaderForResource(ResourceManagerImpl.java:641)
&gt;        at org.apache.velocity.runtime.resource.ResourceManagerImpl.getLoaderNameForResource(ResourceManagerImpl.java:624)
&gt;        at org.apache.velocity.runtime.RuntimeInstance.getLoaderNameForResource(RuntimeInstance.java:1464)
&gt;        at org.apache.velocity.runtime.VelocimacroFactory.initVelocimacro(VelocimacroFactory.java:159)
&gt;        at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:261)
&gt;        at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:107)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (VELOCITY-724) [PATCH] Is junit-3.8.1.jar optional for Velocity as specified in jar dependencies?</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1794562235.1257215999379.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1794562235-1257215999379-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:39:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain resolved VELOCITY-724.
----------------------------------------

    Resolution: Fixed

Hi,

It makes sense to me to upgrade to ant 1.7-- it's been out for a long time.  (and the manual
copying of junit lib is very confusing).

I went ahead and upgraded to ant 1.7 but did not drop junit dependency.  (changed the build
file with your patch and the docs).  It doesn't look like ant comes with junit.  Instead,
if it's in the app classpath, it uses it automatically (no need to copy to lib directory).
 Does this sound right?

Go ahead and reopen the issue if you've further comments.

Thanks for raising the issue.  

WILL

&gt; [PATCH] Is junit-3.8.1.jar optional for Velocity as specified in jar dependencies?
&gt; ----------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-724
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-724
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Build
&gt;    Affects Versions: 1.6.2
&gt;            Reporter: Aruna Venkataraman
&gt;            Priority: Trivial
&gt;             Fix For: 1.7
&gt;
&gt;         Attachments: Build succeeds with junit.jar.jpg, build.patch, current error message.PNG,
jnuit build failed.jpg, revised error message.PNG, svn diff.PNG
&gt;
&gt;
&gt; When i navigate to the build directory in Velocity 1.6.2 and invoke "ant" then the below
error is got:
&gt; Could not create task or type of type: junit. lib\test. 
&gt; Ant could not find the task or a class this task relies upon.
&gt; Refer screenshot
&gt; I deleted the junit-3.8.1.jar file from bin\test-lib as it was specified to be optional,
but it gets created automatically. 
&gt; Do we need to remove the dependency on this junit-3.8.1.jar manually? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-724) [PATCH] Is junit-3.8.1.jar optional for Velocity as specified in jar dependencies?</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c486636417.1257215639457.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c486636417-1257215639457-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:33:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain updated VELOCITY-724:
---------------------------------------

    Attachment:     (was: ant17.patch)

&gt; [PATCH] Is junit-3.8.1.jar optional for Velocity as specified in jar dependencies?
&gt; ----------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-724
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-724
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Build
&gt;    Affects Versions: 1.6.2
&gt;            Reporter: Aruna Venkataraman
&gt;            Priority: Trivial
&gt;             Fix For: 1.7
&gt;
&gt;         Attachments: Build succeeds with junit.jar.jpg, build.patch, current error message.PNG,
jnuit build failed.jpg, revised error message.PNG, svn diff.PNG
&gt;
&gt;
&gt; When i navigate to the build directory in Velocity 1.6.2 and invoke "ant" then the below
error is got:
&gt; Could not create task or type of type: junit. lib\test. 
&gt; Ant could not find the task or a class this task relies upon.
&gt; Refer screenshot
&gt; I deleted the junit-3.8.1.jar file from bin\test-lib as it was specified to be optional,
but it gets created automatically. 
&gt; Do we need to remove the dependency on this junit-3.8.1.jar manually? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Updated: (VELOCITY-724) [PATCH] Is junit-3.8.1.jar optional for Velocity as specified in jar dependencies?</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1860462470.1257215279400.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1860462470-1257215279400-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:27:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-724?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain updated VELOCITY-724:
---------------------------------------

    Attachment: ant17.patch

upgrade requirements to ant 1.7 and drop junit download.  

&gt; [PATCH] Is junit-3.8.1.jar optional for Velocity as specified in jar dependencies?
&gt; ----------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-724
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-724
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Build
&gt;    Affects Versions: 1.6.2
&gt;            Reporter: Aruna Venkataraman
&gt;            Priority: Trivial
&gt;             Fix For: 1.7
&gt;
&gt;         Attachments: ant17.patch, Build succeeds with junit.jar.jpg, build.patch, current
error message.PNG, jnuit build failed.jpg, revised error message.PNG, svn diff.PNG
&gt;
&gt;
&gt; When i navigate to the build directory in Velocity 1.6.2 and invoke "ant" then the below
error is got:
&gt; Could not create task or type of type: junit. lib\test. 
&gt; Ant could not find the task or a class this task relies upon.
&gt; Refer screenshot
&gt; I deleted the junit-3.8.1.jar file from bin\test-lib as it was specified to be optional,
but it gets created automatically. 
&gt; Do we need to remove the dependency on this junit-3.8.1.jar manually? 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>[jira] Resolved: (VELOCITY-717) Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null</title>
<author><name>&quot;Will Glass-Husain (JIRA)&quot; &lt;dev@velocity.apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/velocity-dev/200911.mbox/%3c1532470925.1257214319578.JavaMail.jira@brutus%3e"/>
<id>urn:uuid:%3c1532470925-1257214319578-JavaMail-jira@brutus%3e</id>
<updated>2009-11-03T02:11:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

     [ https://issues.apache.org/jira/browse/VELOCITY-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Will Glass-Husain resolved VELOCITY-717.
----------------------------------------

    Resolution: Cannot Reproduce

resolving.  try with the latest version (from svn head).  if you still have this difficulty,
please reopen the bug and give a little more detail.  Thanks!

&gt; Engine throws an NPE using custom macro libs if the IncludeEventHandler returns null
&gt; ------------------------------------------------------------------------------------
&gt;
&gt;                 Key: VELOCITY-717
&gt;                 URL: https://issues.apache.org/jira/browse/VELOCITY-717
&gt;             Project: Velocity
&gt;          Issue Type: Bug
&gt;          Components: Engine
&gt;    Affects Versions: 1.6.2
&gt;         Environment: Suse Linux
&gt;            Reporter: Johann Weber
&gt;            Priority: Critical
&gt;             Fix For: 1.7
&gt;
&gt;
&gt; The Engine throws an NPE if the IncludeEventHandler returns null.
&gt; (using merge method with a list of macro libs)
&gt;  java.lang.NullPointerException
&gt; &gt;&gt;        at java.util.Hashtable.get(Hashtable.java:333)
&gt; &gt;&gt;        at org.apache.velocity.runtime.VelocimacroManager.getNamespace(VelocimacroManager.java:318)
&gt; &gt;&gt;        at org.apache.velocity.runtime.VelocimacroManager.get(VelocimacroManager.java:215)
&gt; &gt;&gt;        at org.apache.velocity.runtime.VelocimacroFactory.getVelocimacro(VelocimacroFactory.java:563)
&gt; &gt;&gt;        at org.apache.velocity.runtime.RuntimeInstance.getVelocimacro(RuntimeInstance.java:1563)
&gt; &gt;&gt;        at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:218)
&gt; &gt;&gt;        at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
&gt; &gt;&gt;        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
&gt; &gt;&gt;        at org.apache.velocity.runtime.directive.Parse.render(Parse.java:260)
&gt; &gt;&gt;        at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:175)
&gt; &gt;&gt;        at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
&gt; &gt;&gt;        at org.apache.velocity.Template.merge(Template.java:328)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org



</pre>
</div>
</content>
</entry>
</feed>
