On Sun, 31 Dec 2000, John, just a programmer, Woo wrote:
> I have a problem that's different from all those reported in the
> archives. My problem is that it gives me a blank page.
>
> I'm using tdk-1.1a9 with all default values.
> http://localhost:8080/test/servlet/test worked fine. The
> HelloWorld.class (source codes are copied from "Getting Started" and are
> listed at the end of this message) resides in the same place as
> Default.class. This is the url I used
>
> http://localhost:8080/test/servlet/test/screen/HelloWorld
>
> and it gave me a blank page, here's its source
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
> "http://www.w3.org/TR/REC-html40/loose.dtd">
> <html><head><title></title></head><body></body></html>
>
> And here's my HelloWorld.java codes
>
> package org.apache.turbine.modules.screens;
>
> // Turbine Modules
> import org.apache.turbine.modules.*;
> import org.apache.turbine.util.*;
>
> // ECS Classes
> import org.apache.ecs.*;
> import org.apache.ecs.html.*;
>
> public class HelloWorld extends Screen
> {
> public ConcreteElement doBuild(RunData data) throws Exception
> {
> // Set the title of the page.
> data.setTitle("Hello World");
>
> return new StringElement("Hello World");
> }
> }
Your best bet to get something working is to use a generated
app produced by the scripts that come with the TDK. You
will then have a fully working example. There's a couple
problems with what you have above:
1) The use of ECS is deprecated inside Screen classes, it
is recommended that you use Velocity. So your Screen classes
should extend VelocityScreen. The default sample app in
the TDK will produce a Screen based on VelocityScreen
so you can see this in action.
2) If you actually want to look at a particular screen then
the URL for your screen above would be:
http://localhost:8080/test/servlet/test/template/HelloWorld
Turbine internally translates the /template/ into
PATH_TO_TEMPLATES/screens
If you generate a sample app with the TDK then you can
see a working example and this is the recommended way
to go. Just use the newapp.[sh|bat] script provided:
./newapp.sh
or
newapp.bat
And it will produced the sample application.
jvz.
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]