You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by jeff <jl...@houseofdistraction.com> on 2001/04/06 01:54:04 UTC
Dollar sign issues
I just did some testing with latest from CVS and discovered the
following problems
1) The basic $$ problem: (I have mentioned this before)
#set ( $a = "2.99" )
Today's special sale price: $$a
renders as
Today's special sale price: $$a
2) The ${ problem:
${
$a{
$$a{
\${
Any of the above cause an exception that looks something like this:
org.apache.velocity.exception.ParseErrorException: Encountered "\r\n" at line 5, column 12.
Was expecting:
<IDENTIFIER> ...
at org.apache.velocity.Template.process(Template.java:169)
at org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceManager.java:336)
at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:666)
3) The disappearing } problem:
#set( $z = "foo" )
$z}
renders as
foo
I have workarounds for all these but I thought I should report them.
Re: 1.0.1
Posted by Rafal Krzewski <Ra...@e-point.pl>.
"Geir Magnusson Jr." wrote:
> As a followup, if/when we reach agreement on this listener/event thing,
> it shouldn't go into 1.0.1.
>
> It's new functionality. Lets branch 1.1 and put it there?
My advice is, crete a branch for 1.0 and apply the fixes in there, later
tag 1.0.1 on that branch.
Development should go on the HEAD branch (the trunk). This means that
you
will be working on two CVS snapshots in paralel. Not very convinient for
you, but convinient for the users :)
Rafal
--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl
Re: 1.0.1
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
"Geir Magnusson Jr." wrote:
>
> Jon Stevens wrote:
> >
> > How about we shoot for a 1.0.1-b1 this monday and a release by next friday
> > friday?
> >
> > -jon
>
> otay
As a followup, if/when we reach agreement on this listener/event thing,
it shouldn't go into 1.0.1.
It's new functionality. Lets branch 1.1 and put it there?
I will have time tomorrow and sunday for the rest I am working on for
1.0.1, namely the parser fixes noted yesterday, and the node stuff and
tests.
geir
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: 1.0.1
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Jon Stevens wrote:
>
> How about we shoot for a 1.0.1-b1 this monday and a release by next friday
> friday?
>
> -jon
otay
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
1.0.1
Posted by Jon Stevens <jo...@latchkey.com>.
How about we shoot for a 1.0.1-b1 this monday and a release by next friday
friday?
-jon
Re: Dollar sign issues
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Wait.... :)
jeff wrote:
>
> I just did some testing with latest from CVS and discovered the
> following problems
>
> 1) The basic $$ problem: (I have mentioned this before)
>
> #set ( $a = "2.99" )
>
> Today's special sale price: $$a
>
> renders as
> Today's special sale price: $$a
That should be gone. I will look...
> 2) The ${ problem:
>
> ${
> $a{
> $$a{
> \${
>
> Any of the above cause an exception that looks something like this:
> org.apache.velocity.exception.ParseErrorException: Encountered "\r\n" at line 5, column 12.
> Was expecting:
> <IDENTIFIER> ...
>
> at org.apache.velocity.Template.process(Template.java:169)
> at org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceManager.java:336)
> at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:666)
>
> 3) The disappearing } problem:
>
> #set( $z = "foo" )
>
> $z}
>
> renders as
>
> foo
>
> I have workarounds for all these but I thought I should report them.
The last to are odd, and should be an easy fix.
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: Dollar sign issues
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
They will all disappear. Thanks.
geir
jeff wrote:
>
> I just did some testing with latest from CVS and discovered the
> following problems
>
> 1) The basic $$ problem: (I have mentioned this before)
>
> #set ( $a = "2.99" )
>
> Today's special sale price: $$a
>
> renders as
> Today's special sale price: $$a
>
> 2) The ${ problem:
>
> ${
> $a{
> $$a{
> \${
>
> Any of the above cause an exception that looks something like this:
> org.apache.velocity.exception.ParseErrorException: Encountered "\r\n" at line 5, column 12.
> Was expecting:
> <IDENTIFIER> ...
>
> at org.apache.velocity.Template.process(Template.java:169)
> at org.apache.velocity.runtime.resource.ResourceManager.getResource(ResourceManager.java:336)
> at org.apache.velocity.runtime.Runtime.getTemplate(Runtime.java:666)
>
> 3) The disappearing } problem:
>
> #set( $z = "foo" )
>
> $z}
>
> renders as
>
> foo
>
> I have workarounds for all these but I thought I should report them.
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: Dollar sign issues
Posted by Leon Messerschmidt <le...@opticode.co.za>.
> Gee, isnt't this demotivating that released Velocity still has problems
> like that? I remember that that long time ago someone said that quality
> of the parser is going to be the greatest advantage of Velocity over
> WebMacro....
> I guess I still don't use Veloctiy in production environment for a
> reason.
I find much more joy from Velocity than from WebMacro. But that's just me
:-)
> Rafal
>
> PS. I really appreciate your hard work Geir, but the parser bug parade
> seems to be going on forever...
>
> --
> Rafal Krzewski
> Senior Internet Developer
> mailto:Rafal.Krzewski@e-point.pl
> +48 22 8534830 http://e-point.pl
Re: Dollar sign issues
Posted by Christoph Reck <Ch...@gmx.net>.
I fully agree with Geir's response. Using velocity is simple and
straightforward. Logs are good. Bugs normally have been minor,
could be fixed with a patch or using a simple workaround. All on
this list have contributed greatly in getting it ready for release.
Now that its a release, I can really recomend it for a production
environment. Some of you will find some bugs or quirks, but Geir
is an ace in getting them fixed. Patches to fix bugs or inconsitencies
from everyone else are also very welcome.
The Vel-lists have calmed down a lot in the last days, so things
seem to be working fine! Some new users poped in, and I believe
there is a growing community just using it, happy, and silent!
(Or was this due to ApacheCon? But no storm after the calm has
arisen ;)
The parser has been Geir's fiance (I guess theres one person not
wholly happy about this), so we have reported bugs to him instead
of patching. Since the Vel syntax is (now) really simple, I guess
a cleanup uverhaul could solve this and other hidden bugs (are
there somewhere good examples for writing/using javacc?).
At this moment Velocity is in the stage of real world (production)
environment testing. Any problems are fixed quickly and everyone
is happy with it. Some new requirements.proposals are being
evaluated and may find their way into one of the next releases.
Velocity has a good test-bed to avoid breaking current functionality.
Note that the real world will show some new quirks that need to
be fixed and will then be covered by the test-cases. This is the
best way to improve a production release (which initially is prone
to contain some buggies).
Cheers,
:) Christoph
"Geir Magnusson Jr." wrote:
>
> Rafal Krzewski wrote:
> >
> > jeff wrote:
> >
> > > I just did some testing with latest from CVS and discovered the
> > > following problems
> > >
> > > 1) The basic $$ problem: (I have mentioned this before)
> > <snip>
> > > 2) The ${ problem:
> > <snipp>
> > > 3) The disappearing } problem:
> >
> > Gee, isnt't this demotivating that released Velocity still has problems
> > like that? I remember that that long time ago someone said that quality
> > of the parser is going to be the greatest advantage of Velocity over
> > WebMacro....
>
> I'm not sure how demotivating it is. Doesn't bother me at all from the
> user point of view, given the number of hoops I had to jump through in
> WebMacro when I still used it, and how pleasant and nice I find Vel to
> use in my day to day work life. People might want to chime in here
> though.
Chimed above loud and clear!
>
> It bothers the heck out of me as a Velocity committer though, and will
> have the fix in ASAP.
>
> > I guess I still don't use Veloctiy in production environment for a
> > reason.
>
> What reason, and what do you use?
>
> If you are being honest about your sentiments, you can't use WebMacro
> either, because they can't even seem to decide on their syntax... they
> just added a new parser and are deprecating their old one. Enjoy.
>
> > Rafal
> >
> > PS. I really appreciate your hard work Geir, but the parser bug parade
> > seems to be going on forever...
>
> You hve a very good point, but there is a major rewrite I want to do to
> resolve this and related problems in the parser, and wanted to wait
> until after the release 1.0, as the syntax and parser is stable, modulo
> this issue.
>
> geir
>
> --
> Geir Magnusson Jr. geirm@optonline.net
> Developing for the web? See http://jakarta.apache.org/velocity/
Re: Enumerations
Posted by Tim Joyce <ti...@hoop.co.uk>.
Geir,
> I did this yesterday :) Is there something wrong with it?
oops, i should read the cvs notifications more carefully.
> (Thatnks, though.)
no, thank you
cheers
timj
Re: Enumerations
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
I did this yesterday :) Is there something wrong with it?
(Thatnks, though.)
geir
Tim Joyce wrote:
>
> Geir,
>
> > > I would like to be able to #foreach through an Enumeration. Is anyone
> > > receptive to this being added to Velocity?
> >
> > Yep. Should be straightforward. :)
>
> please find attached a new class
> org.apache.velocity.util.EnumerationIterator
>
> also, here is a diff for Foreach.java:
>
> diff Foreach.java Foreach.java.old
> 71d70
> < import org.apache.velocity.util.EnumerationIterator;
> 133,138d131
> <
> < /**
> < * Flag to indicate that the list object being used
> < * is an Enumeration.
> < */
> < private final static int INFO_ENUMERATION = 5;
> 240,241d232
> < else if ( listObject instanceof Enumeration )
> < type = INFO_ENUMERATION;
> 265c256
> < case INFO_ITERATOR :
> ---
> > case INFO_ITERATOR :
> 273d263
> < return ( (Iterator) listObject);
> 275,283c265
> < case INFO_ENUMERATION :
> < Runtime.warn ("Warning! The reference "
> < + node.jjtGetChild(2).getFirstToken().image
> < + " is an Enumeration in the #foreach() loop at
> ["
> < + getLine() + "," + getColumn() + "]"
> < + " in template " +
> context.getCurrentTemplateName()
>
> < + ". If used in more than once, this may lead to
> "
> < + "unexpected results.");
> < return ( new EnumerationIterator( (Enumeration) listObject));
>
> ---
> > return ( (Iterator) listObject);
>
> ------------------------------------------------------------------------
> Name: EnumerationIterator.java
> EnumerationIterator.java Type: unspecified type (application/octet-stream)
> Encoding: quoted-printable
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: Enumerations
Posted by Tim Joyce <ti...@hoop.co.uk>.
Geir,
> > I would like to be able to #foreach through an Enumeration. Is anyone
> > receptive to this being added to Velocity?
>
> Yep. Should be straightforward. :)
please find attached a new class
org.apache.velocity.util.EnumerationIterator
also, here is a diff for Foreach.java:
diff Foreach.java Foreach.java.old
71d70
< import org.apache.velocity.util.EnumerationIterator;
133,138d131
<
< /**
< * Flag to indicate that the list object being used
< * is an Enumeration.
< */
< private final static int INFO_ENUMERATION = 5;
240,241d232
< else if ( listObject instanceof Enumeration )
< type = INFO_ENUMERATION;
265c256
< case INFO_ITERATOR :
---
> case INFO_ITERATOR :
273d263
< return ( (Iterator) listObject);
275,283c265
< case INFO_ENUMERATION :
< Runtime.warn ("Warning! The reference "
< + node.jjtGetChild(2).getFirstToken().image
< + " is an Enumeration in the #foreach() loop at
["
< + getLine() + "," + getColumn() + "]"
< + " in template " +
context.getCurrentTemplateName()
< + ". If used in more than once, this may lead to
"
< + "unexpected results.");
< return ( new EnumerationIterator( (Enumeration) listObject));
---
> return ( (Iterator) listObject);
Re: Enumerations
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tim Joyce wrote:
>
> I would like to be able to #foreach through an Enumeration. Is anyone
> receptive to this being added to Velocity?
Yep. Should be straightforward. :)
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Enumerations
Posted by Tim Joyce <ti...@hoop.co.uk>.
I would like to be able to #foreach through an Enumeration. Is anyone
receptive to this being added to Velocity?
cheers
timj
AvalonLogSystem
Posted by Tim Joyce <ti...@hoop.co.uk>.
It would be nice if a failure to initialize the AvalonLogSystem would write
to stderr, not stdout, as it is then easier to spot the problem.
diff AvalonLogSystem.java.old AvalonLogSystem.java
109c109
< System.out.println(
---
> System.err.println(
148a149
>
cheers
timj
Re: Dollar sign issues
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
"Geir Magnusson Jr." wrote:
> I have a client where quite a few in Vel, converted from WM (I don't
> know the count).
>
Man - I don't even know what that means.... What I meant was I have one
client where we have quite a pile of templates for a diverse set of
application functionality - it's sort of App Serv Prov (ASP) -ish kind
of thing. I don't know the count. We started in WM, but converted.
geir
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: Dollar sign issues
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Rafal Krzewski wrote:
>
> It just makes me worried, that parser problems still keep showing up.
> I'm affraid that we'd get tons of Velocity related issues if we
> start to use it at a large project. For example http://pfm.pl has
> 1.8MB of WebMacro markup in 450 files and http://www.wbksa.pl has
> 1MB in 300 files. We started those before Velocity was available,
> and we aren't going to port them just right now...
The problems that show up are generally related to one root cause. I
have done some preliminary work investigating the solution, but didn't
want to do anything until after release 1.0. It's a biggie.
I have a client where quite a few in Vel, converted from WM (I don't
know the count).
I have another who produces all content dymically via XML/XSLT, and are
able to use Velocity parsing of dynamically generated streams in
realtime - there isn't even templates that we can check for
'correctness' for the most part. There are a few top level ones, but
the rest is dynamic - I have VTL embedded in XSL, even, for the parts we
haven't converted to Anakia-like XML styling. :)
All works like a charm.
I base part of my living and reputation as a consultant on it these
days...
>
> Please don't take me wrong. We'd love to use Velocity, but we are
> anxious how it will work for us.
>
We'd love to see you use Velocity, and are anxious how it will work for
you.
:)
geir
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: Dollar sign issues
Posted by Jon Stevens <jo...@latchkey.com>.
on 4/6/01 5:06 AM, "Rafal Krzewski" <Ra...@e-point.pl> wrote:
> It just makes me worried, that parser problems still keep showing up.
> I'm affraid that we'd get tons of Velocity related issues if we
> start to use it at a large project.
Guess you never worked with PHP in the early days did you? :-)
It took *years* for them to sort out the PHP parser bugs. Mostly because
Rasmus didn't write a very clean parser to begin with.
Anyway, Velocity is much smaller than PHP and will never grow to the size of
PHP so this really is a finite issue with a definite end in sight.
One way you can help is to provide test cases. Maybe we should even go as
far as autogenerating a test case...ie:
$a1
$a2
$a3
$a4
$b1
...
that goes through every single possible character iteration...
-jon
--
If you come from a Perl or PHP background, JSP is a way to take
your pain to new levels. --Anonymous
<http://jakarta.apache.org/velocity/ymtd/ymtd.html>
Re: Dollar sign issues
Posted by Rafal Krzewski <Ra...@e-point.pl>.
"Geir Magnusson Jr." wrote:
> > I guess I still don't use Veloctiy in production environment for a
> > reason.
>
> What reason, and what do you use?
> If you are being honest about your sentiments, you can't use WebMacro
> either, because they can't even seem to decide on their syntax... they
> just added a new parser and are deprecating their old one. Enjoy.
Actually, I use neither. I stay on the code side of things, and for the
most part I'm just developing the core modules of our systems, and
developing Turbine.
The web people in my team use WebMacro. We don't follow the latest and
greatest version of WM, we just use the version that is bundled with
Turbine. It has it's bugs and limitations. (Like limitation on #if
nesting depth). We know them and we live with them ... for now.
We'll be very happy to switch to Velocity for our upcoming OneWebNG
project. Our designers already already played a little bit with Velocity
and liked it a lot.
It just makes me worried, that parser problems still keep showing up.
I'm affraid that we'd get tons of Velocity related issues if we
start to use it at a large project. For example http://pfm.pl has
1.8MB of WebMacro markup in 450 files and http://www.wbksa.pl has
1MB in 300 files. We started those before Velocity was available,
and we aren't going to port them just right now...
Please don't take me wrong. We'd love to use Velocity, but we are
anxious how it will work for us.
Rafal
--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl
Re: Dollar sign issues
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Rafal Krzewski wrote:
>
> jeff wrote:
>
> > I just did some testing with latest from CVS and discovered the
> > following problems
> >
> > 1) The basic $$ problem: (I have mentioned this before)
> <snip>
> > 2) The ${ problem:
> <snipp>
> > 3) The disappearing } problem:
>
> Gee, isnt't this demotivating that released Velocity still has problems
> like that? I remember that that long time ago someone said that quality
> of the parser is going to be the greatest advantage of Velocity over
> WebMacro....
I'm not sure how demotivating it is. Doesn't bother me at all from the
user point of view, given the number of hoops I had to jump through in
WebMacro when I still used it, and how pleasant and nice I find Vel to
use in my day to day work life. People might want to chime in here
though.
It bothers the heck out of me as a Velocity committer though, and will
have the fix in ASAP.
> I guess I still don't use Veloctiy in production environment for a
> reason.
What reason, and what do you use?
If you are being honest about your sentiments, you can't use WebMacro
either, because they can't even seem to decide on their syntax... they
just added a new parser and are deprecating their old one. Enjoy.
> Rafal
>
> PS. I really appreciate your hard work Geir, but the parser bug parade
> seems to be going on forever...
You hve a very good point, but there is a major rewrite I want to do to
resolve this and related problems in the parser, and wanted to wait
until after the release 1.0, as the syntax and parser is stable, modulo
this issue.
geir
--
Geir Magnusson Jr. geirm@optonline.net
Developing for the web? See http://jakarta.apache.org/velocity/
Re: Dollar sign issues
Posted by Rafal Krzewski <Ra...@e-point.pl>.
jeff wrote:
> I just did some testing with latest from CVS and discovered the
> following problems
>
> 1) The basic $$ problem: (I have mentioned this before)
<snip>
> 2) The ${ problem:
<snipp>
> 3) The disappearing } problem:
Gee, isnt't this demotivating that released Velocity still has problems
like that? I remember that that long time ago someone said that quality
of the parser is going to be the greatest advantage of Velocity over
WebMacro....
I guess I still don't use Veloctiy in production environment for a
reason.
Rafal
PS. I really appreciate your hard work Geir, but the parser bug parade
seems to be going on forever...
--
Rafal Krzewski
Senior Internet Developer
mailto:Rafal.Krzewski@e-point.pl
+48 22 8534830 http://e-point.pl