Hi Jeff,
I�m using the 2.3 version now, but the same thing happens!!! That is a
strong indication that << I >> am doing something wrong, but I can�t figure
it out myself.
Everything seems fine except that I can�t access anything that�s put in a
context from a java class. Take a look at the code:
package com.yourcompany.app.modules.screens;
// 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...");
}
}
It is a plain Copy&Paste from Turbine�s HowTo. I figured all I had to do was
put things in the context and they would be available for use in the
templates. Here�s the template:
$page.setTitle("Hello world!!!!!!")
#set( $a = "Velocity" )
<h2> $hello $a testando 12 3 4 5 </h2>
And the output is " $hello Velocity testando 1 .... ". From that I assume
Velocity is working, to some extent at least. I don�t know about Turbine.
By the way, I�m sure the .class file is in the right place, along with the
rest (Index.class and SecureScreen.class). All "build.properties" files and
the "TurbineResources.properties" seem to be in order. I also setted the
context as reloadable in Tomcat.
What could it be?
-----Mensagem original-----
De: Jeff Painter [mailto:[EMAIL PROTECTED]
Enviada em: quarta-feira, 17 de dezembro de 2003 15:47
Para: Gustavo Pinheiro
Assunto: Re: newbie
If you are just starting out, you should probably use the tdk-2.3 I just
put together a week ago. It includes in the sample app a couple of intake
examples and should be a better starting point than the old tdk.
http://kiasoft.com/~painter/tdk-2.3_20031210.tar.gz
On Wed, 17 Dec 2003, Gustavo Pinheiro wrote:
> Hello,
>
> I'm trying to use Turbine+Velocity and I got stuck at the very
> begining. I successfully installed TDK 2.2 and the sample app. But
> when trying to deploy the HelloWorld app contained in the Velocity
> Site HowTo
>
(http://jakarta.apache.org/turbine/turbine-2.3/howto/velocity-site-howto.htm
> l) I ran into trouble. It just doen't work as it should. When I load the
app
> from a browser, it shows "$hello..." instead of the var value ("this is a
> test..."). The java file compiles just fine and the Velocity seems to be
> working since both header and footer are included in the output, but it
> does�t access the variable in the context.
>
> What could I be doing wrong?
>
> Thanks in advance.
>
--
Regards,
Jeffery Painter
- --
[EMAIL PROTECTED] http://kiasoft.com
PGP FP: 9CE8 83A2 33FA 32B1 0AB1 4E62 E4CB E4DA 5913 EFBC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE/qEQE5Mvk2lkT77wRAnMJAJ9vJ6qOkg/mvqqIpz7troCEQJ8bFACglu/U
YNXabx7DZOV2Hd9LwSTmGpY=
=dWiu
-----END PGP SIGNATURE-----
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.552 / Virus Database: 344 - Release Date: 15/12/2003
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]