velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: #stop problem
Date Tue, 08 Jun 2004 04:48:08 GMT
Hi Jian,

#stop is broken (by design, apparently).  If you're adventurous, try
applying the patch given here to the Velocity source, then compile.  (this
makes it work).
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24189

I've never personally needed #stop, as I've found other ways are better for
most situations.

You might try this instead:

#if ($myvariable)
    #parse("file1.vm")
#else
    #parse("file2.vm")
#end

Then put the two alternatives into file1.vm and file2.vm.  Arguably, this is
more intuitive.

WILL


----- Original Message ----- 
From: "chenjian" <chenjian@uvic.ca>
To: "velocity-user" <velocity-user@jakarta.apache.org>
Sent: Monday, June 07, 2004 8:51 PM
Subject: RE: #stop problem, sorry for re-sending


> Hi,
>
> Well, I searched on the developer mailing list and found out that this is
a
> bug as follows:
>
> 24189|New|Enh|2003-10-28|#stop in conditions is not working
>
> So, now the question is, could anyone kindly provide me with some
workaround?
> Otherwise, I have to make up 2 templates, one for the error conditions,
one
> for the good conditions.
>
> Thanks,
>
> Jian
>
>
> >===== Original Message From "Velocity Users List"
> <velocity-user@jakarta.apache.org> =====
> >Hi, All,
> >
>
> >I am not sure if this email goes through, so, trying to do a re-send.
Please
> >forgive me if you get it twice...
> >
> >Hi,
> >
> >I am using version 1.4 (the stable release) of velocity. I am trying to
put
> >#stop in an #if #end structure, so that the page could have some
alternative
> >display.
> >
> >#if ($myvariable)
> >#stop
> >#end
> >
> >But I got the following error:
> >org.apache.velocity.exception.ParseErrorException: Encountered "" at line
31,
> >column 9.
> >
> >Interesting thing is that, if I put #stop outside of the #if statement
block,
> >it works. But that defeats the purpose of having #if block there.
> >
> >Could anyone shed some light on this problem?
> >
> >Thanks a bunch in advance,
> >
> >Jian
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


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


Mime
View raw message