You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Sudhi Tekkala <su...@gmail.com> on 2007/06/20 06:11:13 UTC

hello sir (velocity doubt)

hello sir

actually i am using the velocity 1.5 version itself.... and as if i am going
to use or declare the variable with out the qutations like this:::

#set($a=300.05)
#set($b=500.05)
#set($c=$a+$b)

the velocity engine is displaying some errors like:::

*type* Exception report

*message*

*description* *The server encountered an internal error () that prevented it
from fulfilling this request.*

*exception*

javax.servlet.ServletException:
org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at
line 66, column 48.  Encountered: "2" (50), after : "."
	org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:518)
	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)

*root cause*

org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at
line 66, column 48.  Encountered: "2" (50), after : "."
	org.apache.velocity.Template.process(Template.java:141)



so my thinking is that the decimal points placed in the float or double
value are not detected and if we use qutations ... it is taking the value
as a string but not as float or double...

so please kindly help me in this matter

thanking you



On 6/19/07, Will Glass-Husain <wg...@gmail.com> wrote:
>
> Dear sudhitekkala,
>
> [I'm replying to the user@velocity.apache.org list, which is a better
> place for support and help for Velocity]
>
> Are you using the latest Velocity 1.5?  Previous versions didn't support
> decimal numbers.
>
> Also, I note that your example is not correct.  There should be no quotes
> around the numbers.
>
> #set($a=300.05)
> #set($b=500.05)
> #set($c=$a+$b)
>
> Hope this helps.
>
> Best regards, WILL
>
> On 6/19/07, sudhitekkala <su...@gmail.com> wrote:
> >
> >
> > hello guys
> >
> > actually a problem is araising when i am trying to add the float values
> > or
> > variables in the velocity... for example::
> >
> > #set($a=300)
> > #set($b=500)
> > #set($c=$a+$b) is working correctly and 800 value is displayed
> >
> > but when i am working with the float values i am not getting the
> > calculation
> > like:
> >
> > #set($a="300.05")
> > #set($b="500.05")
> > #set($c="$a+$b") is not working ........... it is showing the value as
> > "$c"
> > in the html page
> >
> > please provide me the guidence......that how to add the two float or
> > string
> > or integer+float values in the velocity page........
> >
> > --
> > View this message in context:
> > http://www.nabble.com/adding-float-values-in-velocity%28velocity-variable-reference%29-tf3945800.html#a11192911
> > Sent from the Velocity - Dev mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: dev-help@velocity.apache.org
> >
> >
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> wglass@forio.com
> www.forio.com




-- 
Regards,
Sudheer T.
Bilingual Software Engineer
SoftBridge Solutions,
PrabhatRoad,
Pune.
919823377838

Re: hello sir (velocity doubt)

Posted by Will Glass-Husain <wg...@gmail.com>.
Are sure that you are using Velocity 1.5?

I just cut and pasted the example below into my installation and it worked
fine.

WILL

On 6/19/07, Sudhi Tekkala <su...@gmail.com> wrote:
>
>
> hello sir
>
> actually i am using the velocity 1.5 version itself.... and as if i am
> going to use or declare the variable with out the qutations like this:::
>
> #set($a=300.05)
> #set($b=500.05)
> #set($c=$a+$b)
>
> the velocity engine is displaying some errors like:::
>
> *type* Exception report
>
> *message*
>
> *description* *The server encountered an internal error () that prevented
> it from fulfilling this request.*
>
> *exception*
>
> javax.servlet.ServletException
> : org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 66, column 48.  Encountered: "2" (50), after : "."
> 	org.apache.struts2.dispatcher.Dispatcher.serviceAction
> (Dispatcher.java:518)
> 	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>
> *root cause*
>
> org.apache.velocity.exception.ParseErrorException
> : Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 66, column 48.  Encountered: "2" (50), after : "."
> 	org.apache.velocity.Template.process(Template.java:141)
>
>
>
> so my thinking is that the decimal points placed in the float or double
> value are not detected and if we use qutations ... it is taking the value
> as a string but not as float or double...
>
> so please kindly help me in this matter
>
> thanking you
>
>
>
> On 6/19/07, Will Glass-Husain <wg...@gmail.com> wrote:
> >
> > Dear sudhitekkala,
> >
> > [I'm replying to the user@velocity.apache.org list, which is a better
> > place for support and help for Velocity]
> >
> > Are you using the latest Velocity 1.5?  Previous versions didn't support
> > decimal numbers.
> >
> > Also, I note that your example is not correct.  There should be no
> > quotes around the numbers.
> >
> > #set($a=300.05)
> > #set($b=500.05)
> > #set($c=$a+$b)
> >
> > Hope this helps.
> >
> > Best regards, WILL
> >
> > On 6/19/07, sudhitekkala < sudhitekkala@gmail.com> wrote:
> > >
> > >
> > > hello guys
> > >
> > > actually a problem is araising when i am trying to add the float
> > > values or
> > > variables in the velocity... for example::
> > >
> > > #set($a=300)
> > > #set($b=500)
> > > #set($c=$a+$b) is working correctly and 800 value is displayed
> > >
> > > but when i am working with the float values i am not getting the
> > > calculation
> > > like:
> > >
> > > #set($a="300.05")
> > > #set($b="500.05")
> > > #set($c="$a+$b") is not working ........... it is showing the value as
> > > "$c"
> > > in the html page
> > >
> > > please provide me the guidence......that how to add the two float or
> > > string
> > > or integer+float values in the velocity page........
> > >
> > > --
> > > View this message in context:
> > > http://www.nabble.com/adding-float-values-in-velocity%28velocity-variable-reference%29-tf3945800.html#a11192911
> > > Sent from the Velocity - Dev mailing list archive at Nabble.com.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: dev-help@velocity.apache.org
> > >
> > >
> >
> >
> > --
> > Forio Business Simulations
> >
> > Will Glass-Husain
> > wglass@forio.com
> > www.forio.com
>
>
>
>
> --
> Regards,
> Sudheer T.
> Bilingual Software Engineer
> SoftBridge Solutions,
> PrabhatRoad,
> Pune.
> 919823377838




-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

RE: hello sir (velocity doubt)

Posted by Marco Schoolenberg <ma...@itris.nl>.
Removing older versions might also help.
At least it used to with velocity 1.1. Also there is more then one place
where jar's can be addressed.
Greets Marco Schoolenberg

-----Oorspronkelijk bericht-----
Van: Nathan Bubna [mailto:nbubna@gmail.com] 
Verzonden: vrijdag 22 juni 2007 6:24
Aan: Velocity Users List
Onderwerp: Re: hello sir (velocity doubt)

On 6/21/07, Will Glass-Husain <wg...@gmail.com> wrote:
> (Please respond to the list, makes it easier for others to chime in).
>
> Do you really have all the files you listed?  Some of them duplicate.  You
> don't need velocity-1.5 if you already have velocity-dep-1.5.  Similarly,
> velocity-tools-1.1-rc is superseded by velocity-tools-1.1.
>
> Anyway, this a bit strange.  Some plugins to Eclipse use Velocity (and
often
> older versions), but the compiled code itself should use the Velocity jars
> in your application.
>
> Do you have any unusual classpath settings that might be loading jars from
> other location?
>
> What type of application is it.  Web?  If so, what is the location of the
> velocity jars (in WEB-INF/lib?)  Could there be other Velocity jars
provided
> by your app server?
>
> WILL
>
> On 6/21/07, Sudhi Tekkala <su...@gmail.com> wrote:
> >
> > hello sir
> >
> > yes i am sure that  i am using the velocity with version 1.5 itself...
as
> > i have added external jar files in the ide eclipse are files like:
> >
> > velocity-1.5
> > velocity-dep-1.5
> > velocity-tools-1.1
> >  velocity-tools-1.1-rc1
> > velocity-tools-generic-1.1
> > velocity-tools-view-1.1

pick just one velocity-tools jar!  velocity-tools-1.1 is the one that
includes everything so you can get rid of the others.  the view jar
excludes the VelocityStruts code, and the generic jar excludes all
servlet dependencies.   and of course, i recommend using
velocity-tools-1.3 instead of 1.1 :)

> > and regarding the error that is the error message that i got when i used
> > the value assigned to the variable a and b as 300.25 and
500.25respectively
> >
> > so please kindly check whether any thing else is required for my program
> > to run... other wise tell me the configuration that i have to follow to
run
> > that code....
> >
>
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
>

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



__________ NOD32 2343 (20070621) Informatie __________

Dit bericht is gecontroleerd door het NOD32 Antivirus Systeem.
http://www.nod32.nl



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


Re: hello sir (velocity doubt)

Posted by Nathan Bubna <nb...@gmail.com>.
On 6/21/07, Will Glass-Husain <wg...@gmail.com> wrote:
> (Please respond to the list, makes it easier for others to chime in).
>
> Do you really have all the files you listed?  Some of them duplicate.  You
> don't need velocity-1.5 if you already have velocity-dep-1.5.  Similarly,
> velocity-tools-1.1-rc is superseded by velocity-tools-1.1.
>
> Anyway, this a bit strange.  Some plugins to Eclipse use Velocity (and often
> older versions), but the compiled code itself should use the Velocity jars
> in your application.
>
> Do you have any unusual classpath settings that might be loading jars from
> other location?
>
> What type of application is it.  Web?  If so, what is the location of the
> velocity jars (in WEB-INF/lib?)  Could there be other Velocity jars provided
> by your app server?
>
> WILL
>
> On 6/21/07, Sudhi Tekkala <su...@gmail.com> wrote:
> >
> > hello sir
> >
> > yes i am sure that  i am using the velocity with version 1.5 itself... as
> > i have added external jar files in the ide eclipse are files like:
> >
> > velocity-1.5
> > velocity-dep-1.5
> > velocity-tools-1.1
> >  velocity-tools-1.1-rc1
> > velocity-tools-generic-1.1
> > velocity-tools-view-1.1

pick just one velocity-tools jar!  velocity-tools-1.1 is the one that
includes everything so you can get rid of the others.  the view jar
excludes the VelocityStruts code, and the generic jar excludes all
servlet dependencies.   and of course, i recommend using
velocity-tools-1.3 instead of 1.1 :)

> > and regarding the error that is the error message that i got when i used
> > the value assigned to the variable a and b as 300.25 and 500.25respectively
> >
> > so please kindly check whether any thing else is required for my program
> > to run... other wise tell me the configuration that i have to follow to run
> > that code....
> >
>
>
>
> --
> Forio Business Simulations
>
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
>

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


Re: hello sir (velocity doubt)

Posted by Will Glass-Husain <wg...@gmail.com>.
(Please respond to the list, makes it easier for others to chime in).

Do you really have all the files you listed?  Some of them duplicate.  You
don't need velocity-1.5 if you already have velocity-dep-1.5.  Similarly,
velocity-tools-1.1-rc is superseded by velocity-tools-1.1.

Anyway, this a bit strange.  Some plugins to Eclipse use Velocity (and often
older versions), but the compiled code itself should use the Velocity jars
in your application.

Do you have any unusual classpath settings that might be loading jars from
other location?

What type of application is it.  Web?  If so, what is the location of the
velocity jars (in WEB-INF/lib?)  Could there be other Velocity jars provided
by your app server?

WILL

On 6/21/07, Sudhi Tekkala <su...@gmail.com> wrote:
>
> hello sir
>
> yes i am sure that  i am using the velocity with version 1.5 itself... as
> i have added external jar files in the ide eclipse are files like:
>
> velocity-1.5
> velocity-dep-1.5
> velocity-tools-1.1
>  velocity-tools-1.1-rc1
> velocity-tools-generic-1.1
> velocity-tools-view-1.1
>
> and regarding the error that is the error message that i got when i used
> the value assigned to the variable a and b as 300.25 and 500.25respectively
>
> so please kindly check whether any thing else is required for my program
> to run... other wise tell me the configuration that i have to follow to run
> that code....
>



-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

Re: hello sir (velocity doubt)

Posted by Will Glass-Husain <wg...@gmail.com>.
Also -- why does the error message say: Encountered: "2" (50), after : "."

when there is no "2" in the example.  Did you try that example as shown?

WILL

On 6/19/07, Sudhi Tekkala <su...@gmail.com> wrote:
>
>
> hello sir
>
> actually i am using the velocity 1.5 version itself.... and as if i am
> going to use or declare the variable with out the qutations like this:::
>
> #set($a=300.05)
> #set($b=500.05)
> #set($c=$a+$b)
>
> the velocity engine is displaying some errors like:::
>
> *type* Exception report
>
> *message*
>
> *description* *The server encountered an internal error () that prevented
> it from fulfilling this request.*
>
> *exception*
>
> javax.servlet.ServletException
> : org.apache.velocity.exception.ParseErrorException: Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 66, column 48.  Encountered: "2" (50), after : "."
> 	org.apache.struts2.dispatcher.Dispatcher.serviceAction
> (Dispatcher.java:518)
> 	org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:421)
>
> *root cause*
>
> org.apache.velocity.exception.ParseErrorException
> : Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 66, column 48.  Encountered: "2" (50), after : "."
> 	org.apache.velocity.Template.process(Template.java:141)
>
>
>
> so my thinking is that the decimal points placed in the float or double
> value are not detected and if we use qutations ... it is taking the value
> as a string but not as float or double...
>
> so please kindly help me in this matter
>
> thanking you
>
>
>
> On 6/19/07, Will Glass-Husain <wg...@gmail.com> wrote:
> >
> > Dear sudhitekkala,
> >
> > [I'm replying to the user@velocity.apache.org list, which is a better
> > place for support and help for Velocity]
> >
> > Are you using the latest Velocity 1.5?  Previous versions didn't support
> > decimal numbers.
> >
> > Also, I note that your example is not correct.  There should be no
> > quotes around the numbers.
> >
> > #set($a=300.05)
> > #set($b=500.05)
> > #set($c=$a+$b)
> >
> > Hope this helps.
> >
> > Best regards, WILL
> >
> > On 6/19/07, sudhitekkala < sudhitekkala@gmail.com> wrote:
> > >
> > >
> > > hello guys
> > >
> > > actually a problem is araising when i am trying to add the float
> > > values or
> > > variables in the velocity... for example::
> > >
> > > #set($a=300)
> > > #set($b=500)
> > > #set($c=$a+$b) is working correctly and 800 value is displayed
> > >
> > > but when i am working with the float values i am not getting the
> > > calculation
> > > like:
> > >
> > > #set($a="300.05")
> > > #set($b="500.05")
> > > #set($c="$a+$b") is not working ........... it is showing the value as
> > > "$c"
> > > in the html page
> > >
> > > please provide me the guidence......that how to add the two float or
> > > string
> > > or integer+float values in the velocity page........
> > >
> > > --
> > > View this message in context:
> > > http://www.nabble.com/adding-float-values-in-velocity%28velocity-variable-reference%29-tf3945800.html#a11192911
> > > Sent from the Velocity - Dev mailing list archive at Nabble.com.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> > > For additional commands, e-mail: dev-help@velocity.apache.org
> > >
> > >
> >
> >
> > --
> > Forio Business Simulations
> >
> > Will Glass-Husain
> > wglass@forio.com
> > www.forio.com
>
>
>
>
> --
> Regards,
> Sudheer T.
> Bilingual Software Engineer
> SoftBridge Solutions,
> PrabhatRoad,
> Pune.
> 919823377838




-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com