You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Bragg, Casey" <Ca...@allegiancetelecom.com> on 2001/05/07 22:37:15 UTC
Newbie Q : Getting Started
Hello...
I'm using the Turbine distribution of Velocity and I'm having trouble
getting started.
I'm trying to follow the introductory example from
http://jakarta.apache.org/turbine/velocity-site.html
Here is the output of my test of
http://localhost:8080/test/servlet/test/template/HelloWorld.vm. Appname =
test.
-------------------------------------------------------------------------
$hello of the emergency broadcast station.
Hello Velocity1 World!
-------------------------------------------------------------------------
Here is my screen file : /tdk/webapps/test/templates/screens/HelloWorld.vm
-------------------------------------------------------------------------
<html>
<head><title>Hello World</title> </head>
<body bgcolor="#ffffff">
<p><font color="red">$hello of the emergency broadcast station.</font></p>
<p>
#set( $foo = "Velocity1" )
Hello $foo World!
</p>
</body>
</html>
-------------------------------------------------------------------------
Here is the class associated with my HelloWorld.vm screen :
/tdk/webapps/test/WEB-INF/classes/turbinetest/HelloWorld.class
-------------------------------------------------------------------------
package turbinetest;
// 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...");
}
}
-------------------------------------------------------------------------
Apparently my HelloWorld.class can't be found. I assume its because
HelloWorld.class is in the turbinetest package. Is there something else I
should place in my HelloWorld.vm file to specify the HelloWorld.class
package name?
Thanks...
...Casey
==============================================
Casey Bragg - Software Engineer
Allegiance Telecom, Inc. Dallas, TX
469-259-2702 - casey.bragg@allegiancetelecom.com
==============================================
Re: Newbie Q : Getting Started
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
"Bragg, Casey" wrote:
>
> Hello...
>
> I'm using the Turbine distribution of Velocity and I'm having trouble
> getting started.
>
> I'm trying to follow the introductory example from
> http://jakarta.apache.org/turbine/velocity-site.html
>
> Here is the output of my test of
> http://localhost:8080/test/servlet/test/template/HelloWorld.vm. Appname =
> test.
>
> -------------------------------------------------------------------------
> $hello of the emergency broadcast station.
> Hello Velocity1 World!
> -------------------------------------------------------------------------
>
> Here is my screen file : /tdk/webapps/test/templates/screens/HelloWorld.vm
>
> -------------------------------------------------------------------------
> <html>
> <head><title>Hello World</title> </head>
> <body bgcolor="#ffffff">
> <p><font color="red">$hello of the emergency broadcast station.</font></p>
> <p>
> #set( $foo = "Velocity1" )
> Hello $foo World!
> </p>
> </body>
> </html>
> -------------------------------------------------------------------------
>
> Here is the class associated with my HelloWorld.vm screen :
> /tdk/webapps/test/WEB-INF/classes/turbinetest/HelloWorld.class
>
> -------------------------------------------------------------------------
> package turbinetest;
>
> // 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...");
> }
> }
> -------------------------------------------------------------------------
>
> Apparently my HelloWorld.class can't be found. I assume its because
> HelloWorld.class is in the turbinetest package. Is there something else I
> should place in my HelloWorld.vm file to specify the HelloWorld.class
> package name?
>
> Thanks...
Welcome to the Velocity user list. This list is really focused on
Velocity only - your question seems to be related to turbine, so you
should ask on that list.
geir
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/
"still climbing up to the shoulders..."