John - This is a confusing one but I think I know where you are having the
issue.
In TR.props you need to add the package name *above* the screens package
... so
in my sample HelloWorld project I stored all my .java files for screens in
com.context.turbine.modules.screens and set module.packages to
com.context.turbine.modules ... Turbine will add on the 'screens' portion
itself
when looking for a screen.
Example:
module.packages=com.context.turbine.modules
Class lives in:
/WEB-INF/classes/com/context/turbine/modules/screens/HelloWorld.class
I hope that helps. I think the one directory off thing messed me up till I
read
the source for the actual Turbine servlet ... which somehow helped.
cheers
ian
-----Original Message-----
From: John Noronha
To: [EMAIL PROTECTED]
Sent: 6/6/01 1:46 PM
Subject: Re: HelloWorld in Velocity ...
Tried putting HelloWorld.java into a package (org.mycompany.newapp.om)
under
web-inf\classes as suggested, and since this package is defined in
newapp.properties (newapp being the sample application I created after
installing the TDK) ...however it still doesn't get picked up by
Turbine/Velocity. Also tried adding this package to
TurbineResources.properties (module.packages). BTW, I stopped and
restarted
Tomcat after each change and before refreshing explorer. Can think of
what
to do next !
Regards
John
----- Original Message -----
From: John Noronha <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 8:41 PM
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]