I would recommend using FreeMarkerSiteLayout and FreeMarkerSitePage as your
defaults in TurbineResources.  Make sure to get the latest copy of these as
well as TurbineFreeMarkerService as I just checked in a small change.  Then
you can have urls like:

http://mymachine/servlet/Turbine/template/,my_fm_temp.html

Please note the comma.  The path separator is a comma and the template
parameter should start with the comma.  I think that is why you were missing
the File.separator.

The FreeMarker stuff needs to be brought up-to-date with the WebMacro
service.  Its still very usable but Dave Bryson, et. al. have improved the
WM service and the FM service can take advantage of these improvements
(caching).  I will try to get to it, but I have a few other things on my
plate and I am not using FM for anything right now.  If you can live with
its limitations you might want to use WM, as you will find more support.
But I still think some of the stuff in FM is worth the ugly syntax.

John McNally

----- Original Message -----
From: Travis Low <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Tuesday, July 11, 2000 2:00 PM
Subject: Re: Where to put FreeMarker templates?


> Thanks -- that enabled me to find the problem.  The template name is
> appended to the template path without the File.separator.  It worked
> fine when I hardcoded the correct path in
> TurbineFreeMarkerService.handleRequest().  So I'll just subclass it
> for each template.  =)
>
> I'll look for the place where the template path is set up, but if you
> know offhand, would you be so kind as to tell me?  Thanks!
>
> -- Travis
>
> John McNally wrote:
> >
> > For a quick test try something like:
> > >
> >
http://mymachine/servlet/Turbine/screen/BaseFreeMarkerScreen/template/my_fm_
> > temp.html
> >
> > Otherwise set up your properties for FreeMarkerSitePage and skip the
screen
> > parameter.
> >
> > I will try to look at this later, but I am trying to get some
> > BasePeer/IDBroker changes checked in before I run out of "free" time.
> >
> > John McNally
> >
> > ----- Original Message -----
> > From: Travis Low <[EMAIL PROTECTED]>
> > To: Turbine <[EMAIL PROTECTED]>
> > Sent: Tuesday, July 11, 2000 12:54 PM
> > Subject: Where to put FreeMarker templates?
> >
> > > Okay, maybe I'm stupid, but I've been at this for five hours and I
> > > still can't figure out where to put the freemarker templates or how to
> > > specify them in the URL.  I'm just trying to get the freemarker
> > > example to work.  When I browse to:
> > >
> > > http://mymachine/servlet/Turbine/screen/BaseFreeMarkerScreen
> > >
> > > I get a NPE because no template is found.  In
> > > TurbineResources.properties, I specified a services.freemarker.path
> > > and then I copied the examples/freemarker directory into it.
> > >
> > > The log says:
> > >
> > > [Tue Jul 11 15:46:48 EDT 2000] --  ERROR  --
> > >  Error encountered processing a template:screensnull
> > > [Tue Jul 11 15:46:48 EDT 2000] --  ERROR  --
> > > Exception:  java.lang.NullPointerException:
> > > Stack Trace follows:
> > > java.lang.NullPointerException:
> > > at org.apache.turbine.services.freemarker.
> > >         TurbineFreeMarkerService.handleRequest
> > >         (TurbineFreeMarkerService.java:299)
> > > at org.apache.turbine.modules.screens.
> > >         BaseFreeMarkerScreen.doBuildTemplate
> > >         (BaseFreeMarkerScreen.java:160)
> > > at org.apache.turbine.modules.screens.
> > >         BaseFreeMarkerScreen.doBuild
> > >         (BaseFreeMarkerScreen.java:105)
> > > at org.apache.turbine.modules.
> > >         Screen.build(Screen.java:88)
> > > at org.apache.turbine.modules.
> > >         ScreenLoader.eval(ScreenLoader.java:117)
> > > at org.apache.turbine.modules.
> > >         layouts.DefaultLayout.doBuild(DefaultLayout.java:96)
> > > at org.apache.turbine.modules.
> > >         Layout.build(Layout.java:81)
> > > at org.apache.turbine.modules.
> > >         LayoutLoader.exec(LayoutLoader.java:111)
> > > at org.apache.turbine.modules.pages.
> > >         DefaultPage.doBuild(DefaultPage.java:134)
> > > at org.apache.turbine.modules.Page.build
> > >         (Page.java:81)
> > > at org.apache.turbine.modules.
> > >         PageLoader.exec(PageLoader.java:111)
> > > at Turbine.doGet(Turbine.java:298)
> > > at javax.servlet.http.
> > >         HttpServlet.service(HttpServlet.java:499)
> > > at javax.servlet.http.HttpServlet.
> > >         service(HttpServlet.java:588)
> > > at org.apache.jserv.
> > >         JServConnection.processRequest
> > >         (JServConnection.java:317)
> > > at org.apache.jserv.JServConnection.run
> > >         (JServConnection.java:188)
> > > at java.lang.Thread.run(Thread.java:475)
> > >
> > > Please help!
> > >
> > > -- Travis Low
> > >    [EMAIL PROTECTED]
> > >    1-301-592-6305 (direct)
> > >
> > > || StayConnect
> > > || 10750 Columbia Pike, Silver Spring MD 20901
> > > || 1-888-304-7829 (toll free)  1-301-592-6304 (fax)
> > > || http://www.stayconnect.com
> > >
> > >
> > > ------------------------------------------------------------
> > > To subscribe:        [EMAIL PROTECTED]
> > > To unsubscribe:      [EMAIL PROTECTED]
> > > Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> > > Problems?:           [EMAIL PROTECTED]
> > >
> >
> > ------------------------------------------------------------
> > To subscribe:        [EMAIL PROTECTED]
> > To unsubscribe:      [EMAIL PROTECTED]
> > Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> > Problems?:           [EMAIL PROTECTED]
>
> -- Travis Low
>    [EMAIL PROTECTED]
>    1-301-592-6305 (direct)
>
> || StayConnect
> || 10750 Columbia Pike, Silver Spring MD 20901
> || 1-888-304-7829 (toll free)  1-301-592-6304 (fax)
> || http://www.stayconnect.com
>
>
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]
>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to