You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Paul Smith <Pa...@lawlex.com.au> on 2002/09/12 08:38:27 UTC
RE: Reference problem with velocity
In your TurbineResources.properties file, what is your "module.packages"
property set to?
You might want to names your Java file with a proper package name like
"mypackage.screens" (Screen java objects need to be in a package with a name
ending ".screens") Then add "mypackage" to the "module.packages" list and
Turbine should match "HelloWorld.vm" to the "HelloWorld.class" file.
cheers,
Paul
-----Original Message-----
From: apdas [mailto:apdas@iitk.ac.in]
Sent: Friday, September 13, 2002 1:47 AM
To: Turbine User
Subject: Reference problem with velocity
Hi friends,
I have put the date object in velocity context.
The source code looks like this.
public class HelloWorld extends VelocityScreen
import org.apache.velocity.context.Context;
import java.util.*;
// 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
{
Date d=new Date();
context.put ("date",d);
}
}
In my vm file I am calling the object as $date
Please give some tips.
Regards,
A.P.Das.
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>