velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Velocity vs. Servlets
Date Tue, 05 Nov 2002 18:58:24 GMT
On 11/5/02 1:25 PM, "Philipp Leusmann"
<> wrote:

> Hi,
> I am currently in the process of beginning to write a web-application. Since
> the design has to be customizable I would like to use Velocity as a template
> engine.
> But what is not quite clear to me, yet, is the way how servlets using
> velocity compare to servlets written usings SunĀ“s Servlet API.

You would still use Sun's Servlet API.

Velocity offers an example servlet 'VelocityServlet' which is derived from
HTTPServlet - to everything is the servlet API.

You don't have to use the VelocityServlet - it's offered for your
convenience.  Most people use it though.

> Will I have to write everything in the Sun-servlet-style and only use
> subclasses of VelocityServlet instead of subclasses of HTTPServlet and the
> rest stays the same (for example Listeners etc)? Or will I have to go a
> completely different way?

You can use your own servlets and just use Velocity - I do that in many
projects where I don't want to use the response handling model of the
VelocityServlet. (For most of the things I do, I find that model

Rather, my base class takes care of all the config of the velocity engine,
and I just use it in the methods in my servlet.

Remember - Velocity itself is agnostic to the system in which you use it (as
long as it's Java :).  So use the example Velocity servlet for convenience,
or if you have other needs that doesn't fit, roll your own and just use the
Velocity engine.

> Hope you can answer my question,
> Philipp
> --
> To unsubscribe, e-mail:
> <>
> For additional commands, e-mail:
> <>

Geir Magnusson Jr.                                    +1-203-355-2219 (w)
Adeptra Inc.                                         +1-203-247-1713 (m)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message