velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Burcham" <>
Subject RE: Simple Startup Question
Date Fri, 09 May 2003 12:31:20 GMT
Hey look, one I can answer. :)

Tomcat is a servlet engine and thus runs servlets.  (it also happens to
have a built in web server which is handy).  So by installing and
running tomcat you have a self-contained web server + servlet engine so
you can start building a web app (which can be witnessed by hitting:
http://localhost:8080 after installing tomcat).  

But of course you want to write your own web pages and so there are a
couple of ways to do it.

1) jsp (but this isn't necessarily the best way)
2) write a servlet that outputs html using print statements (this gets
hard to manage pretty much instantly)
3) write a servlet that uses velocity templates for the output

of course we all like option 3.  So from your servlet you simply
instantiate the velocity engine and call getTemplate(filename) and away
you go.

Inherent in option 3, tho, quickly becomes the need to do complex
things.  That's where struts comes in.  It is a servlet framework that
you can use instead of writing a bunch of your own code to handle
complex needs.  But you don't have to start out with struts.  

Hope that helps and isn't too elementary.


-----Original Message-----
From: Nathan Bubna [] 
Sent: Thursday, May 08, 2003 2:37 PM
To: Velocity Users List
Subject: Re: Simple Startup Question

Joseph said:
> Can someone please explain to me the
> marraige between Tomcat and Velocity?  I am missing a major aspect

yep.  :-)  you need a servlet/framework to process your templates.  I
do not recommend using the VelocityServlet included in velocity's core
library.  At this point, it is meant primarily as an example.  work on
supporting web development with velocity has shifted more to the
velocity-tools project.  so, if you plan to use Velocity for
developing web applications, i *strongly* suggest checking out either
velocity-tools (works great w/Struts!) or a web framework that offers
built-in Velocity support (Turbine, WebWork, JPublish, etc.)

personally, i think you'll find the velocity-tools project to be the
quickest way to get your feet wet.  it's feature set is not as full as
a framework's (nor is it that the intent of the project), but when
used with Struts (a very popular framework), i have found it to be
quite useful.  (but i'm biased :).

we don't have the latest docs up on the jakarta site yet, but Tim
Colson is currently keeping a set on his site:

Nathan Bubna

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

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

View raw message