You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Antonio Ortega <ao...@fihoca.com> on 2001/03/05 10:19:33 UTC

parse problem

Hello to all the velocity comunity!
I'm a computer science student at the university, and now i'm trying
the Turbine framework, but the problem is about velocity { if not
why i'm here? ; )  }
Well, the question is that I can't make work 
the "parse" command under a template. It's seems to do nothing.
Here there is a trivial code :

______________________________________________________
Index.vm:

#set ($helloscreen = "helloscreen.vm")
<br>
#include ($helloscreen)
<br>
#parse($helloscreen)
<br>
#include ("helloscreen.vm")
<br>
#parse ("helloscreen.vm")
<br>


helloscreen.vm

#set ($hello "Hello from the helloscreen!!")
$hello

_______________________________________________________

All it's putted into the correct directory, and "include's" work
but the "parse's" not. What i'm doing wrong??


_________________
      Toni Ortega
aortega@fihioca.com
_________________





Re: #include, #parse problem (can't find template)

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Jim Reesman wrote:
> 
> Hi,
> 
> I'm trying to use #include and #parse directives, but can't seem to get them
> to work. Velocity.log reports
> 
> [info] ResourceManager : found navigations/breadcrumbs.vm with loader blah,
> blah...
> [error] #include : cannot find navigations/breadcrumbs.vm template!
> 
> when handling a .vm that contains
> 
> $navigation.setTemplate("breadcrumbs.vm")
> 
> and
> 
> #include("navigations/breadcrumbs.vm")

This is a turbine thing?

The problem might be that "navigations" is in the template path, so
Velocity will actually then try

"navigations/navigations/breadcrumbs.vm"

Therefore, try

#include("breadcrumbs.vm")


> 
> The .path property is set properly and reported correctly in velocity.log
> (and all
> 'automatically' loaded templates are working fine...).
> 
> Is there a known explanation for this, or can someone please give me some
> pointers
> on what to check as I begin to debug this?

Let us know...

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
Well done is better than well said - New England Proverb

#include, #parse problem (can't find template)

Posted by Jim Reesman <ji...@syntricity.com>.
Hi,

I'm trying to use #include and #parse directives, but can't seem to get them
to work. Velocity.log reports

[info] ResourceManager : found navigations/breadcrumbs.vm with loader blah,
blah...
[error] #include : cannot find navigations/breadcrumbs.vm template!

when handling a .vm that contains

$navigation.setTemplate("breadcrumbs.vm")

and

#include("navigations/breadcrumbs.vm")

The .path property is set properly and reported correctly in velocity.log
(and all
'automatically' loaded templates are working fine...).

Is there a known explanation for this, or can someone please give me some
pointers
on what to check as I begin to debug this?

Thanks,

Jim


Re: parse problem

Posted by Jason van Zyl <jv...@periapt.com>.
Antonio Ortega wrote:

> Hello to all the velocity comunity!
> I'm a computer science student at the university, and now i'm trying
> the Turbine framework, but the problem is about velocity { if not
> why i'm here? ; )  }
> Well, the question is that I can't make work
> the "parse" command under a template. It's seems to do nothing.
> Here there is a trivial code :
>
> ______________________________________________________
> Index.vm:
>
> #set ($helloscreen = "helloscreen.vm")
> <br>
> #include ($helloscreen)
> <br>
> #parse($helloscreen)
> <br>
> #include ("helloscreen.vm")
> <br>
> #parse ("helloscreen.vm")
> <br>
>
> helloscreen.vm
>
> #set ($hello "Hello from the helloscreen!!")

That should be

#set ($hello = "Hello from the helloscreen!!")


>
> $hello
>
>

The #include will work fine because it doesn't parse
the file, but #parse does :-) And you have a syntax error
in the helloscreen.vm template which is why it isn't working.

Look in your velocity.log file, you will probably notice a Parse
Exception
error.

--
jvz.

Jason van Zyl
jvanzyl@periapt.com

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine