velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@adeptra.com>
Subject Re: Velocity vs. Servlets
Date Tue, 05 Nov 2002 18:58:24 GMT
On 11/5/02 1:25 PM, "Philipp Leusmann"
<philipp.leusmann@post.rwth-aachen.de> 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
inappropriate).

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.

Geir
 
> Hope you can answer my question,
> Philipp
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
> 

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



--
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