Some facts
- Using TDK 2.1
- Successfully built and adaquately played with the sample site - (Something
works)
- Have added a couple stand-alone Velocity pages to the sample site.
- Now want to add servlet/template pages
1) Using the "Velocity Site How-To" I have created two files, ripped almost
exactly from the doc.
----------------------------------------------------------------
a. HelloWorld.vm
----------------------------------------------------------------
<p>
<font color="red">
$hello of the emergency broadcast station.
</font>
</p>
----------------------------------------------------------------
b. HelloWorld.class (no errors compiling )
----------------------------------------------------------------
// Velocity Stuff
import org.apache.velocity.context.Context;
import java.util.Vector;
// Turbine Stuff
import org.apache.turbine.util.RunData;
import org.apache.turbine.modules.screens.VelocityScreen;
public class HelloWorld extends VelocityScreen
{
public final String hello = "This is a test";
public void doBuildTemplate( RunData data, Context context )
throws Exception
{
// the context object has already been setup for you!
context.put ("hello", hello);
}
public String getHello(){
return hello;
}
}
----------------------------------------------------------------
----------------------------------------------------------------
3) I dropped the .vm file in:
[fullpath]\myapp\templates\app\screens
4) And the .class file in
[fullpath]\myapp\WEB-INF\classes\com\myco\myapp\modules\screens
5) I added the .class file to the classpath
6) I registered the servet in web.xml as such
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorld.class</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>/velocity.properties</param-value>
</init-param>
</servlet>
7) I added the link to the navigation on the sample app
<a href="$link.setPage("HelloWorld.vm")">HelloWorld</a>
and it works, well sort of.
8) Started Tomcat
----------------------------------------------------------------
Here's the problem
----------------------------------------------------------------
The Flux docs fly just fine, when I click the link for my own lame attempt,
the output from the request is a vapid
"$hello of the emergency broadcast station."
This, as I understand it, is due to the servlet failing to initialize and
dump something into the context called $hello. (push model)
What am I missing?
I turn to the list ...
Thanks in advance to any who can respond.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]