velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Edgar" <>
Subject RE: MVC with velocity
Date Fri, 15 Jul 2005 00:11:54 GMT
Hi Andrew,

You are right what is typically called MVC in web applications, is
actually a command pattern with a separate tier for rendering.

The original MVC pattern is a sophisticated Observer (publish/subscribe)
pattern for rich clients, where and views and controls (as they are
often the same thing) are updated when modifications are made to data
via a control. This is why there was so much discussion about Push and
Pull MVC in the early days as people tried to figure out how the could
label web applications as MVC.

See section on JSP &
MVC for more details.

regards Malcolm Edgar

-----Original Message-----
From: Andrew Mason []
Sent: Friday, 15 July 2005 12:46 AM
Subject: MVC with velocity

Hi, just trying to understand the model view controller design pattern
and how 
to apply Velocity to it.
I've got a web-app, which has a main-control web-page with links as such
one side (it currently uses a velocity servlet to render a template to
it to the browser): 
 - Edit Products 
  - Add Product 
  - Edit Products 
  - Remove Products 
 - Manage Emails 
  - Add account 
  - Remove account 
So far I have it working like this: 
Clicking on 'Add Product'  means that a new page loads with controls on
right, which allow you to add a product . Which then of course provides
a form to add the product. This obviously goes off to the database to
add the
product then returns the details to the screen. All of these pages are 
by the velocity servlet. 
I have classes which are called in the velocity servlet, that do things
adding products, getting product information etc..but ultimately its 1 
velocity servlet that handles adding the product  and then gettingthe
product info and rendering the template. 
I then have another velocity servlet which handles editing the products,

another one for removing etc..

Correct me if i'm wrong but this doesn't seem like i'm using MVC
pattern, and 
I was hoping someone could post an example (not code) of how to handle
problem using MVC, with servlets and velocity. I've read quite a few
articles and books (Mastering tomcat development etc..) on it but i am
trouble grasping how i would use it in this
thanks in advance

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

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

View raw message