Is the java file in a the correct package? This took me a
while to get but you specify in the TR.prop's file the place
where your modules are (a package name) and then under that
pacakge you need to have 'screens' package, and the HelloWorld
screen needs to be there. Otherwise the Turbine servlet never
finds it.
Hope I am correct, I've been lurking now for a few weeks, and
figure it's time to start trying to answer some of these questions.
ian
-----Original Message-----
From: John Noronha
To: [EMAIL PROTECTED]
Sent: 6/6/01 11:11 AM
Subject: Re: HelloWorld in Velocity ...
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]