You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Will Glass-Husain <wg...@forio.com> on 2001/07/13 22:43:30 UTC

reporting bugs

Hi,

What's the preferred place to report bugs in Velocity?

I attach my bug report at the end of this message for reference, although
I'd be glad to forward it to the appropriate spot.

Thanks, WILL


**************

Bug Report

Velocity version: 1.1rc2
Tomcat version: 3.2.2
JDK: 1.3.1
OS: Linux

Problem:
I put a badly formatted statement in my template file.  (I mistakenly typed
in an HTML editor instead of a text editor, resulting in a quote being
entered as '&quot;' instead of '"'.  Instead of throwing a
ParseErrorException, my HTML output said "Internal Servlet Error" and
printed a stacktrace.  Oddly, my servlet encloses the call to "getTemplate"
in a try/catch statement, so an exception should have been caught.  Fixing
the bad statement in the template file caused the error to go away.

The incorrect statement was:
#set ($a = &quot;Price&quot;)

This resulted in the following output:

Internal Servlet Error:

org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 46,
column 13.  Encountered: "q" (113), after : "&"
	at
org.apache.velocity.runtime.parser.ParserTokenManager.getNextToken(ParserTok
enManager.java:3536)
	at
org.apache.velocity.runtime.parser.Parser.jj_scan_token(Parser.java:3055)
	at org.apache.velocity.runtime.parser.Parser.jj_3R_48(Parser.java:2329)
	at org.apache.velocity.runtime.parser.Parser.jj_3R_35(Parser.java:2455)
	at org.apache.velocity.runtime.parser.Parser.jj_3R_21(Parser.java:2512)
	at org.apache.velocity.runtime.parser.Parser.jj_3_6(Parser.java:2904)
	at org.apache.velocity.runtime.parser.Parser.jj_2_6(Parser.java:2213)
	at org.apache.velocity.runtime.parser.Parser.Expression(Parser.java:1522)
	at org.apache.velocity.runtime.parser.Parser.Assignment(Parser.java:1573)
	at org.apache.velocity.runtime.parser.Parser.Expression(Parser.java:1523)
	at org.apache.velocity.runtime.parser.Parser.SetDirective(Parser.java:1464)
	at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:295)
	at org.apache.velocity.runtime.parser.Parser.process(Parser.java:245)
	at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:105)
	at org.apache.velocity.runtime.Runtime.parse(Runtime.java:619)
	at org.apache.velocity.Template.process(Template.java:164)
	at
org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceMan
ager.java:388)
	at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:686)
	at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:668)
	at
org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java
:501)
	at SimServer.handleRequest(SimServer.java:194)
	at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
33)
	at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
	at org.apache.tomcat.core.Handler.service(Handler.java:287)
	at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
	at java.lang.Thread.run(Thread.java:484)


Re: reporting bugs

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Sorry Will - was a big fuzzy-headed when I read this...

Tim is right and I just fixed it - it's in the CVS HEAD - so either do
an update from the CVS HEAD if you normally build Velocity from there. 
If not, checkout a copy from CVS if you want it today, or wait until the
nightly build for today (available tomorrow).

What you will see is that the TokenManagerError is now turned into a
ParserException - and at app level, getTemplate() will now throw a
ParseErrorException for this, like it would for a syntax error.

geir

Will Glass-Husain wrote:
> 
> Hi,
> 
> What's the preferred place to report bugs in Velocity?
> 
> I attach my bug report at the end of this message for reference, although
> I'd be glad to forward it to the appropriate spot.
> 
> Thanks, WILL
> 
> **************
> 
> Bug Report
> 
> Velocity version: 1.1rc2
> Tomcat version: 3.2.2
> JDK: 1.3.1
> OS: Linux
> 
> Problem:
> I put a badly formatted statement in my template file.  (I mistakenly typed
> in an HTML editor instead of a text editor, resulting in a quote being
> entered as '&quot;' instead of '"'.  Instead of throwing a
> ParseErrorException, my HTML output said "Internal Servlet Error" and
> printed a stacktrace.  Oddly, my servlet encloses the call to "getTemplate"
> in a try/catch statement, so an exception should have been caught.  Fixing
> the bad statement in the template file caused the error to go away.
> 
> The incorrect statement was:
> #set ($a = &quot;Price&quot;)
> 
> This resulted in the following output:
> 
> Internal Servlet Error:
> 
> org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 46,
> column 13.  Encountered: "q" (113), after : "&"
>         at
> org.apache.velocity.runtime.parser.ParserTokenManager.getNextToken(ParserTok
> enManager.java:3536)
>         at
> org.apache.velocity.runtime.parser.Parser.jj_scan_token(Parser.java:3055)
>         at org.apache.velocity.runtime.parser.Parser.jj_3R_48(Parser.java:2329)
>         at org.apache.velocity.runtime.parser.Parser.jj_3R_35(Parser.java:2455)
>         at org.apache.velocity.runtime.parser.Parser.jj_3R_21(Parser.java:2512)
>         at org.apache.velocity.runtime.parser.Parser.jj_3_6(Parser.java:2904)
>         at org.apache.velocity.runtime.parser.Parser.jj_2_6(Parser.java:2213)
>         at org.apache.velocity.runtime.parser.Parser.Expression(Parser.java:1522)
>         at org.apache.velocity.runtime.parser.Parser.Assignment(Parser.java:1573)
>         at org.apache.velocity.runtime.parser.Parser.Expression(Parser.java:1523)
>         at org.apache.velocity.runtime.parser.Parser.SetDirective(Parser.java:1464)
>         at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:295)
>         at org.apache.velocity.runtime.parser.Parser.process(Parser.java:245)
>         at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:105)
>         at org.apache.velocity.runtime.Runtime.parse(Runtime.java:619)
>         at org.apache.velocity.Template.process(Template.java:164)
>         at
> org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceMan
> ager.java:388)
>         at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:686)
>         at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:668)
>         at
> org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java
> :501)
>         at SimServer.handleRequest(SimServer.java:194)
>         at
> org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 33)
>         at
> org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
>         at org.apache.tomcat.core.Handler.service(Handler.java:287)
>         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>         at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7)
>         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>         at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Ajp12ConnectionHandler.java:166)
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>         at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
>         at java.lang.Thread.run(Thread.java:484)

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Re: reporting bugs

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
To answer the question, bugs can be reported here or in bugzilla.

http://jakarta.apache.org/site/bugs.html

The only bug here is that you weren't able to catch the exception.  Can
you post the actual try/catch block?

geir

Will Glass-Husain wrote:
> 
> Hi,
> 
> What's the preferred place to report bugs in Velocity?
> 
> I attach my bug report at the end of this message for reference, although
> I'd be glad to forward it to the appropriate spot.
> 
> Thanks, WILL
> 
> **************
> 
> Bug Report
> 
> Velocity version: 1.1rc2
> Tomcat version: 3.2.2
> JDK: 1.3.1
> OS: Linux
> 
> Problem:
> I put a badly formatted statement in my template file.  (I mistakenly typed
> in an HTML editor instead of a text editor, resulting in a quote being
> entered as '&quot;' instead of '"'.  Instead of throwing a
> ParseErrorException, my HTML output said "Internal Servlet Error" and
> printed a stacktrace.  Oddly, my servlet encloses the call to "getTemplate"
> in a try/catch statement, so an exception should have been caught.  Fixing
> the bad statement in the template file caused the error to go away.
> 
> The incorrect statement was:
> #set ($a = &quot;Price&quot;)
> 
> This resulted in the following output:
> 
> Internal Servlet Error:
> 
> org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 46,
> column 13.  Encountered: "q" (113), after : "&"
>         at
> org.apache.velocity.runtime.parser.ParserTokenManager.getNextToken(ParserTok
> enManager.java:3536)
>         at
> org.apache.velocity.runtime.parser.Parser.jj_scan_token(Parser.java:3055)
>         at org.apache.velocity.runtime.parser.Parser.jj_3R_48(Parser.java:2329)
>         at org.apache.velocity.runtime.parser.Parser.jj_3R_35(Parser.java:2455)
>         at org.apache.velocity.runtime.parser.Parser.jj_3R_21(Parser.java:2512)
>         at org.apache.velocity.runtime.parser.Parser.jj_3_6(Parser.java:2904)
>         at org.apache.velocity.runtime.parser.Parser.jj_2_6(Parser.java:2213)
>         at org.apache.velocity.runtime.parser.Parser.Expression(Parser.java:1522)
>         at org.apache.velocity.runtime.parser.Parser.Assignment(Parser.java:1573)
>         at org.apache.velocity.runtime.parser.Parser.Expression(Parser.java:1523)
>         at org.apache.velocity.runtime.parser.Parser.SetDirective(Parser.java:1464)
>         at org.apache.velocity.runtime.parser.Parser.Statement(Parser.java:295)
>         at org.apache.velocity.runtime.parser.Parser.process(Parser.java:245)
>         at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:105)
>         at org.apache.velocity.runtime.Runtime.parse(Runtime.java:619)
>         at org.apache.velocity.Template.process(Template.java:164)
>         at
> org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceMan
> ager.java:388)
>         at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:686)
>         at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:668)
>         at
> org.apache.velocity.servlet.VelocityServlet.getTemplate(VelocityServlet.java
> :501)
>         at SimServer.handleRequest(SimServer.java:194)
>         at
> org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 33)
>         at
> org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
>         at org.apache.tomcat.core.Handler.service(Handler.java:287)
>         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>         at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7)
>         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>         at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Ajp12ConnectionHandler.java:166)
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>         at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
>         at java.lang.Thread.run(Thread.java:484)

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Re: reporting bugs

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tim Joyce wrote:
>
> [SNIP]
> 
> bizarely I reported this to webmacro a couple of days ago.  I IMHO javacc
> has a bug where it throws Errors and not Exceptions when it hits token
> problems.
> 
>   public class TokenMgrError extends Error
> 
> Anyway brian fixed this by catching and wraping:
> 
>       catch (TokenMgrError e) {
>         throw new ParseException("Lexical error: " + e.toString());
>       }
> 
> I know this doesn't help you, but as it's occured twice, perhaps someone
> should raise this with the Javacc people.

Will do on both counts...

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Re: reporting bugs

Posted by Tim Joyce <ti...@hoop.co.uk>.
Will,

> I put a badly formatted statement in my template file.  (I mistakenly
typed
> in an HTML editor instead of a text editor, resulting in a quote being
> entered as '&quot;' instead of '"'.  Instead of throwing a
> ParseErrorException, my HTML output said "Internal Servlet Error" and
> printed a stacktrace.  Oddly, my servlet encloses the call to
"getTemplate"
> in a try/catch statement, so an exception should have been caught.

it's an error, not an exception :(

> Fixing
> the bad statement in the template file caused the error to go away.
>
> The incorrect statement was:
> #set ($a = &quot;Price&quot;)

bizarely I reported this to webmacro a couple of days ago.  I IMHO javacc
has a bug where it throws Errors and not Exceptions when it hits token
problems.

  public class TokenMgrError extends Error


Anyway brian fixed this by catching and wraping:

      catch (TokenMgrError e) {
        throw new ParseException("Lexical error: " + e.toString());
      }

I know this doesn't help you, but as it's occured twice, perhaps someone
should raise this with the Javacc people.

cheers

timj



Re: Integers and numbers in a comparison expression

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> > > The condition failed even though $num was higher than 7.
> > >
> > > Why not to throw an exception if the type of $num is invalid for
> > > the expression ?
> >
> > We could - we already log it.  An exception might be the way to go...
> 
> Oh, there is a log, I was not aware of it. Where is it found ? We are using
> the Velcoty app class and don't have any special configuration for the log,
> we
> are just configuring the the template loaders.

Oh, yes, there is a good log (so I think anyway).  The default log is
placed in the 'current directory' - if you are not paying attention in a
webapp, that will be the directory you start tomcat (or whatever) from
:)

See the servlet_example2 on how to ensure the velocity.log is placed in
your webapp.  Currently it goes into the root of your webapp (which
isn't so great...), but it still a good example..

And yes, teh log messages are rather complete and descriptive.

> 
> > > Also, without knowing much of the Velocity code, it looks to me that
> > > it would not be that difficult to convert a String value "134" to
> > > an integer when a integer value is required in the expression.
> > For example,
> > > one can write a generic method getIntegerValue(Object)->int that gets
> > > String, Long, Float, etc and converts then to an int. If the type
> > > of Object is invalid or the value does not represent an valid
> > numeric value
> > > than it can throw an exception. Am I missing something ?
> >
> > No - we've gone over this a few times. It is easy to do, but we wanted
> > to keep things simple.
> 
> Do you mean simple implementation or simple to the designer that
> use the template ? For the user, the ability to use strings in the
> expression will
> be simpler IMHO.
> 
> Tal

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

RE: Integers and numbers in a comparison expression

Posted by Tal Dayan <ta...@zapta.com>.
> > The condition failed even though $num was higher than 7.
> >
> > Why not to throw an exception if the type of $num is invalid for
> > the expression ?
>
> We could - we already log it.  An exception might be the way to go...

Oh, there is a log, I was not aware of it. Where is it found ? We are using
the Velcoty app class and don't have any special configuration for the log,
we
are just configuring the the template loaders.


> > Also, without knowing much of the Velocity code, it looks to me that
> > it would not be that difficult to convert a String value "134" to
> > an integer when a integer value is required in the expression.
> For example,
> > one can write a generic method getIntegerValue(Object)->int that gets
> > String, Long, Float, etc and converts then to an int. If the type
> > of Object is invalid or the value does not represent an valid
> numeric value
> > than it can throw an exception. Am I missing something ?
>
> No - we've gone over this a few times. It is easy to do, but we wanted
> to keep things simple.

Do you mean simple implementation or simple to the designer that
use the template ? For the user, the ability to use strings in the
expression will
be simpler IMHO.

Tal


Re: Integers and numbers in a comparison expression

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> Thanks for the info. We figured it the hard way ;-)
> 
> We passed numeric values as a Long and
> 
>    num value ...... [$num]
> 
> worked well (since it has a toString() representation)
> but when we used it in a condition like (free syntax) :
> 
>   #if $num > 7
> 
> The condition failed even though $num was higher than 7.
> 
> Why not to throw an exception if the type of $num is invalid for
> the expression ?

We could - we already log it.  An exception might be the way to go...

> 
> Also, without knowing much of the Velocity code, it looks to me that
> it would not be that difficult to convert a String value "134" to
> an integer when a integer value is required in the expression. For example,
> one can write a generic method getIntegerValue(Object)->int that gets
> String, Long, Float, etc and converts then to an int. If the type
> of Object is invalid or the value does not represent an valid numeric value
> than it can throw an exception. Am I missing something ?

No - we've gone over this a few times. It is easy to do, but we wanted
to keep things simple.

This is one of the rough spots, certainly.  It will improve.

> 
> Tal
> 
> > -----Original Message-----
> > From: gmj@mta2.srv.hcvlny.cv.net [mailto:gmj@mta2.srv.hcvlny.cv.net]On
> > Behalf Of Geir Magnusson Jr.
> > Sent: Friday, July 13, 2001 7:00 PM
> > To: velocity-user@jakarta.apache.org
> > Subject: Re: Integers and numbers in a comparison expression
> >
> >
> > Tal Dayan wrote:
> > >
> > > If a template has a numeric comparison such as
> > >
> > > #if ($num > 7)
> > >
> > > Does $num have to be an Integer or can it also be a Long or
> > even a String ?
> >
> > Just an integer.  Working out a way to do Longs nicely, and forget about
> > strings... :)
> >
> > >
> > > What about the case where $num did not come externaly from the
> > application
> > > Java code
> > > but from the template itself as in
> > >
> > > #set $num = 3
> >
> > Ahem.
> >
> > #set($num = 3)
> >
> > > Will the numeric comparison still work ok ?
> >
> > Yes - that's an Integer.
> >
> > > What about
> > >
> > > #set $num = "3" ?
> >
> > #set( $num = "3")  or #set($num = '3')
> >
> > no, that's a string.
> >
> > > Thanks,
> > >
> > > Tal
> >
> > geir
> >
> > --
> > Geir Magnusson Jr.                           geirm@optonline.net
> > System and Software Consulting
> > Developing for the web?  See http://jakarta.apache.org/velocity/
> > You have a genius for suggesting things I've come a cropper with!
> >

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

RE: Integers and numbers in a comparison expression

Posted by Tal Dayan <ta...@zapta.com>.
Thanks for the info. We figured it the hard way ;-)

We passed numeric values as a Long and

   num value ...... [$num]

worked well (since it has a toString() representation)
but when we used it in a condition like (free syntax) :

  #if $num > 7

The condition failed even though $num was higher than 7.

Why not to throw an exception if the type of $num is invalid for
the expression ?

Also, without knowing much of the Velocity code, it looks to me that
it would not be that difficult to convert a String value "134" to
an integer when a integer value is required in the expression. For example,
one can write a generic method getIntegerValue(Object)->int that gets
String, Long, Float, etc and converts then to an int. If the type
of Object is invalid or the value does not represent an valid numeric value
than it can throw an exception. Am I missing something ?

Tal


> -----Original Message-----
> From: gmj@mta2.srv.hcvlny.cv.net [mailto:gmj@mta2.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> Sent: Friday, July 13, 2001 7:00 PM
> To: velocity-user@jakarta.apache.org
> Subject: Re: Integers and numbers in a comparison expression
>
>
> Tal Dayan wrote:
> >
> > If a template has a numeric comparison such as
> >
> > #if ($num > 7)
> >
> > Does $num have to be an Integer or can it also be a Long or
> even a String ?
>
> Just an integer.  Working out a way to do Longs nicely, and forget about
> strings... :)
>
> >
> > What about the case where $num did not come externaly from the
> application
> > Java code
> > but from the template itself as in
> >
> > #set $num = 3
>
> Ahem.
>
> #set($num = 3)
>
> > Will the numeric comparison still work ok ?
>
> Yes - that's an Integer.
>
> > What about
> >
> > #set $num = "3" ?
>
> #set( $num = "3")  or #set($num = '3')
>
> no, that's a string.
>
> > Thanks,
> >
> > Tal
>
> geir
>
> --
> Geir Magnusson Jr.                           geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> You have a genius for suggesting things I've come a cropper with!
>


Re: Integers and numbers in a comparison expression

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> If a template has a numeric comparison such as
> 
> #if ($num > 7)
> 
> Does $num have to be an Integer or can it also be a Long or even a String ?

Just an integer.  Working out a way to do Longs nicely, and forget about
strings... :)

> 
> What about the case where $num did not come externaly from the application
> Java code
> but from the template itself as in
> 
> #set $num = 3

Ahem.

#set($num = 3)
 
> Will the numeric comparison still work ok ?

Yes - that's an Integer.
 
> What about
> 
> #set $num = "3" ?

#set( $num = "3")  or #set($num = '3')

no, that's a string.
 
> Thanks,
> 
> Tal

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Integers and numbers in a comparison expression

Posted by Tal Dayan <ta...@zapta.com>.
If a template has a numeric comparison such as

#if ($num > 7)

Does $num have to be an Integer or can it also be a Long or even a String ?

What about the case where $num did not come externaly from the application
Java code
but from the template itself as in

#set $num = 3

Will the numeric comparison still work ok ?

What about

#set $num = "3" ?

Thanks,

Tal