Hi, If I understand what you're trying to do, I'd recommend looking into the pull model. There is a HOWTO on the Turbine-2 section of the Jakarta Turbine web site that covers this in better detail.
The basic idea is that instead of creating classes for each template, you create classes (called tools)that are accessible by any Velocity template. A simple example would be a tool called TimeTool that has getHour() and getMinute() methods. Create a Java class that implements org.apache.turbine.services.pull.ApplicationTool. Add an entry to TurbineResources.properties (look at the Pull Model HOWTO and the Pull Service documentation) for the tool. Your velocity template might have a line that looks like this: Time is $time.getHour : $time.getMinute The $time comes from your entry in the TurbineResources.properties, which would look like this: tool.global.time=com.yourcompany.turbine.tools.TimeTool Hope this helps, Jeff ----- Original Message ----- From: "Mark Nutter" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 12, 2002 2:06 PM Subject: Velocity context for Login.vm > I'm still fairly new to Turbine and am trying to do some customization > of the sample app I built when I did the TDK 2.1 HowTo. Just as a > trivial trial run, I want to add a timestamp to the page you see when > you first go to the site. It's a rendering of Login.vm, so I assumed I > could just create a Login.java--I accomplished the same thing by editing > Index.vm and Index.java. But it seems Login.vm is a special case. My > Login class is never called. I even tested it by deliberately putting a > divide-by-zero bug in doBuildTemplate(), but Login.vm comes up without a > whimper. I just copied Index.java to Login.java and changed the > classname, and saved it in the same directory, so I'm confident I'm not > putting it in the wrong place. > > I've read the docs both in the /site directory and on the Jakarta web > site, and nothing jumps out at me. I've tried to trace the program flow > by reading Turbine.java and trying to trace through the various imports > and method calls, but I'm just confusing myself. > > Anybody got a quick and easy pointer for me? If there's a doc or source > file somewhere, I'm not afraid to read it, I just don't know where to > look. Of course, more complete answers are welcome as well, even if > it's "You can't do that." > > Am I barking up a wrong tree? My ultimate goal is to have a public > front page with a certain amount of dynamic content that you can see > without having to log in, and then after you log in you get extra > functions. Do I just have to bite the bullet and go the > custom-SessionValidator route? > > Thanks. > > Mark Nutter > [EMAIL PROTECTED] > My horoscope says today is a bad day to be superstitious. > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
