velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles N. Harvey III" <charl...@alloy.com>
Subject RE: velocity and tomcat
Date Tue, 26 Mar 2002 17:09:39 GMT
I have been messing about with VelocityServlet for more than a month
now and have actually been getting somewhere.  I don't have much java
exp. that's why its taking me so long.

Just recently I started investigating WebWork and ActionServlet.  Both
of these allow you to configure Velocity as the view (or jsp or WebMacro).

But aside from that I wrote a ControllerServlet that extends VelocityServlet
to do some controlling of my own.  It reads the request URI (which is
something
like http://localhost/news/index.vm) and then finds the template file
/news/index.vm in the correct directory.  This directory is what I have
setup
in my velocity properties file.  So it takes the url value, finds the
correct
template (if it exists) and returns that to the merge feature of velocity.

All this gets done in the processRequest() part of the ControllerServlet.
Like I said though, I am a beginner here so I have started looking into
existing
projects like WebWork.  Although, it did feel good to do it myself for the
learning process - it has made it easier for me to understand these other
projects.

Charlie

> -----Original Message-----
> From: Darren Gilroy [mailto:DGilroy@CONSONUS.com]
> Sent: Tuesday, March 26, 2002 11:49 AM
> To: 'Velocity Users List'
> Subject: RE: velocity and tomcat
>
>
> Craig -
>
> Well, the sort answer is, you don't.  At least I think you don't.  Most
> individuals choose to use a servlet as the controller.  This
> servlet builds
> your velocity context and calls the merge.  In your web.xml you map .vm
> files to this servlet.
>
> Several good controller servlets exist, I use turbine
> (jakrata.apache.org),
> but it's pretty heavy weight if you just want to output some velocity
> templates.  I think others use something called "ActionServlet" and have
> seen good results.
>
> I think there is a "VelocityServlet" interface if you wish to
> build your own
> basic controller.
>
> That's what I know.  Sorry I can't be more specific.
>
> -best-darr-
>
> > -----Original Message-----
> > From: Craig Longman [mailto:craigl@begeek.com]
> > Sent: Monday, March 25, 2002 8:53 AM
> > To: velocity-user@jakarta.apache.org
> > Subject: velocity and tomcat
> >
> >
> > hello there,
> >
> > i'm sure this must be a faq, and/or covered in the documentation
> > somewhere, but seeing as i can find neither, i have to ask this.
> >
> > how does one configure velocity as the handler for certain extensions in
> > tomcat?
> >
> > i've got it all installed, i've run the tests, i've some examples in the
> > existing tomcat4/conf/web.xml file to create entries to process the
> > files; i used the jsp processor as an example, but why is there nothing
> > included with velocity to show this?
> >
> > i'm starting to think that perhaps velocity has no methods for
> > integrating directly as a template processor in tomcat, but that seems
> > very strange as all the comparisons compare it directly to other
> > webserver template engines.
> >
> > please point me to where i need to go to figure this out, i'm very keen
> > on using velocity.
> >
> > thanks,
> >
> > --
> >
> >      CraigL->Thx();
> >      Be Developer ID: 5852
>
>
> --
> To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message