The velocity log file (extract reproduced below) states '$hello is not a
valid reference'. Why ?

Thanks
John
.......
Wed Jun 06 20:12:03 GMT+05:30 2001   [info] ResourceManager : found
/screens/HelloWorld.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Jun 06 20:12:03 GMT+05:30 2001   [warn]
org.apache.velocity.runtime.exception.ReferenceException: reference :
template = /screens/HelloWorld.vm [line 3,column 9] : $hello is not a valid
reference.
Wed Jun 06 20:12:03 GMT+05:30 2001   [info] ResourceManager : found
layouts/Default.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Jun 06 20:12:03 GMT+05:30 2001   [info] ResourceManager : found
navigations//DefaultTop.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Jun 06 20:12:03 GMT+05:30 2001   [info] ResourceManager : found
navigations//Menu.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
Wed Jun 06 20:12:03 GMT+05:30 2001   [info] ResourceManager : found
navigations//DefaultBottom.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader

----- Original Message -----
From: John Noronha <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 8:17 PM
Subject: HelloWorld in Velocity ...


> Having a problem running the velocity HelloWorld example (from
> VelocitySite.html).....
>
> HelloWorld.java compiled okay in /WEB-INF/classes.Then I copied
> HelloWorld.vm into /templates/screens. On entering
> http://localhost:8080/newapp/servlet/newapp/template/HelloWorld.vm, the
> following is displayed ...
>
>
> $hello of the emergency broadcast station
>
> instead of ...
>
> this is a test ....of the emergency broadcast station
>
> Where did I go wrong ?
>
>
> Thanks
> John Noronha
>
> HelloWorld.java::
>
> // Velocity Stuff
> import org.apache.velocity.context.Context;
>
> // Turbine Stuff
> import org.apache.turbine.util.RunData;
> import org.apache.turbine.modules.screens.VelocityScreen;
>
> public class HelloWorld extends VelocityScreen
> {
>     public void doBuildTemplate( RunData data, Context context )
>         throws Exception
>     {
>         // the context object has already been setup for you!
>         context.put ("hello", "this is a test...");
>     }
> }
>
> HelloWorld.vm ::
>
> <p>
>     <font color="red">
>         $hello of the emergency broadcast station.
>     </font>
> </p>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to