Jeff,

Thanks for the education.  I really had no idea of how the initialization 
and processing occurred.

By the way, I looked at the velocity-tools cvs tree and it really hasn't 
changed recently (last 6 weeks) -- so what I did, is as you suggest, extend 
VelocityViewServlet and override some key methods, no big deal.  At least, 
no biggie, now that I understand the process.  ;-)

Once again, I really appreciate your assistance.

As an aside, Maverick has been very easy to use.  The two places where I've 
stumbled have had to do with setup, first with how to setup a logging file 
and now with velocity initialization.


Take care,
Dan



At 11:54 AM 2/14/02 -0800, Jeff Schnitzer wrote:
> > From: Dan Finkelstein [mailto:[EMAIL PROTECTED]]
> >
> > Hi -- this really helped.  Ok, now I understand how the Velocity
> > initialization occurs.  It appears that VelocityView Servlet doesn't
>allow
> > for a user-specified properties file, to override settings or say,
> > redirect
> > its logging file (from the server log).  It is not really documented,
>and
> > relies on other supporting classes like Toolbox and ChainedContext and
> > WebAppLoader, which are also not documented.  Gosh, what really is
>this
> > Toolbox all about?
>
>To be honest, I'm not completely sure how to use all these features
>myself.  The best answers will come from Geir and others on the
>velocity-user list; they are very good about answering questions.
>
> > What I did was pull out what seemed to be the bare essentials, and
>added
> > it
> > to an initialization servlet of my own making.
>
>You might also want to consider subclassing the VelocityViewServlet to
>add your functionality; I know it was designed with this in mind.
>
>Also, the VelocityViewServlet is rapidly being improved; you might want
>to take a look at the latest version in velocity's cvs tree.  I don't
>know if it addresses the properties or not, but I vaguely recall someone
>talking about it on the velocity-user list.
>
> > Maverick comes up ok now, I see the Velocity log output where I want
>it,
> > meaning that it was initialized by my servlet.  There is only one
>problem:
> > velocity is not processing the pages, so I just see the unprocessed
> > velocity templates in the browser.
> > I have a small question for now:  How does Maverick decide which
>template
> > processor to use to transform files?  I understand that Velocity is
>being
> > initialized, but how is Maverick "connected" to it?  Does Maverick
>base
> > it's decision on filename extensions?
>
>Maverick itself doesn't really know (or need to know) anything about the
>VelocityViewServlet.  Maverick just forwards to a document and expects
>the web container to figure out how to properly process it.
>
>This is the same way that JSP works.  Your web container automatically
>maps all requests for *.jsp to its implementation of a JSPServlet.  You
>need to configure your web.xml to map *.vm (or whatever extension your
>templates have) to the VelocityViewServlet.  There is an example of this
>in friendbook-velocity:
>
>http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mav/opt-velocity/examples
>/friendbook-velocity/WEB-INF/web.xml?rev=1.2&content-type=text/vnd.viewc
>vs-markup
>
>So while it is based on extension, it's not Maverick that does it, it's
>your web container.
>
>BTW, the key to making this work is that the VelocityViewServlet wraps
>the normal servlet attribute collections (request, session, application)
>in a fa�ade that looks like the normal velocity Context.  So really,
>using Velocity with Maverick is *just like* using JSP, only more
>pleasant :-)
>
> > Is there only one transform
> > capability supported at a time?
>
>I'm not sure I understand what you mean here... keep in mind that the
>idea of a "view" and a "transform" are distinct in Maverick.  Views
>render the model.  Some views allow transforms which manipulate the
>output of a view.  Velocity isn't a transform, it's a "view" - it starts
>with the JavaBean model.
>
>Make sense?
>
>Jeff Schnitzer
>[EMAIL PROTECTED]
>
>_______________________________________________
>Mav-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/mav-user


_______________________________________________
Mav-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mav-user

Reply via email to