You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Aaron Freeman <aa...@layerz.com> on 2003/07/24 09:14:29 UTC

Servlet/HTML Page Question

I have just installed Velocity and read both the User's Guide and the
Developer's Guide.  Now I am trying to think through the architecture of my
site.  I am using Jetty and Servlets so it seems like running Velocity
within a Servlet is the way to go for me.  What I am not clear is that it
seems like I am expected to write a servlet for each page that in my
website.  Is that correct?

If so, I could always write a fairly fancy servlet that basically implements
a state machine inside of it.

Am I missing something?

Aaron Freeman
Layer-Z, Inc.
Phone: (316) 729-9968
Fax: (215) 895-9813
aaron@layerz.com
http://www.layerz.com/


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


RE: Servlet/HTML Page Question

Posted by Aaron Freeman <aa...@layerz.com>.
Ah, this makes sense!  Thanks for the direction.

Aaron Freeman
Layer-Z, Inc.
Phone: (316) 729-9968
Fax: (215) 895-9813
aaron@layerz.com
http://www.layerz.com/


> -----Original Message-----
> From: Christoph.Reck@dlr.de [mailto:Christoph.Reck@dlr.de]
> Sent: Thursday, July 24, 2003 2:47 AM
> To: Velocity Users List
> Subject: Re: Servlet/HTML Page Question
>
>
> Hi Aaron,
>
> you normally use one servlet to serve the rendered HTML pages (and if you
> want: XML and or binary data) via velocity.
>
> A very good starting point for your application is the VelocityViewServlet
> in the velocity-tools subproject. Here you can influence the tools and
> values available for the instance, each session, and every request. See:
>    http://jakarta.apache.org/velocity/tools/view/
> Take a special note on the VelocityLayoutServlet which will ease creating
> a look-alike set of pages.
>
> For more complex applications you should look at the frameworks - listed
> at the bottom of the "powered by" page:
>    http://jakarta.apache.org/velocity/powered.html
>
> If you have different disjunct aspects/areas in your application (where
> the source and responsibility are separate), consider creating more than
> one servlet, each with its own configuration.
>
> Cheers,
> Christoph
>
> Aaron Freeman wrote:
> > I have just installed Velocity and read both the User's Guide and the
> > Developer's Guide.  Now I am trying to think through the
> architecture of my
> > site.  I am using Jetty and Servlets so it seems like running Velocity
> > within a Servlet is the way to go for me.  What I am not clear
> is that it
> > seems like I am expected to write a servlet for each page that in my
> > website.  Is that correct?
> >
> > If so, I could always write a fairly fancy servlet that
> basically implements
> > a state machine inside of it.
> >
> > Am I missing something?
> >
> > Aaron Freeman
> > Layer-Z, Inc.
> > Phone: (316) 729-9968
> > Fax: (215) 895-9813
> > aaron@layerz.com
> > http://www.layerz.com/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> >
> >
>
> --
> :) Christoph Reck
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>


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


Re: Servlet/HTML Page Question

Posted by Ch...@dlr.de.
Hi Aaron,

you normally use one servlet to serve the rendered HTML pages (and if you
want: XML and or binary data) via velocity.

A very good starting point for your application is the VelocityViewServlet
in the velocity-tools subproject. Here you can influence the tools and
values available for the instance, each session, and every request. See:
   http://jakarta.apache.org/velocity/tools/view/
Take a special note on the VelocityLayoutServlet which will ease creating
a look-alike set of pages.

For more complex applications you should look at the frameworks - listed
at the bottom of the "powered by" page:
   http://jakarta.apache.org/velocity/powered.html

If you have different disjunct aspects/areas in your application (where
the source and responsibility are separate), consider creating more than
one servlet, each with its own configuration.

Cheers,
Christoph

Aaron Freeman wrote:
> I have just installed Velocity and read both the User's Guide and the
> Developer's Guide.  Now I am trying to think through the architecture of my
> site.  I am using Jetty and Servlets so it seems like running Velocity
> within a Servlet is the way to go for me.  What I am not clear is that it
> seems like I am expected to write a servlet for each page that in my
> website.  Is that correct?
> 
> If so, I could always write a fairly fancy servlet that basically implements
> a state machine inside of it.
> 
> Am I missing something?
> 
> Aaron Freeman
> Layer-Z, Inc.
> Phone: (316) 729-9968
> Fax: (215) 895-9813
> aaron@layerz.com
> http://www.layerz.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

-- 
:) Christoph Reck


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


Re: Servlet/HTML Page Question

Posted by Simon Christian <si...@stoutstick.com>.
Hi Aaron,

You certainly don't have to write a servlet for each page. Most people 
use some sort of controller servlet or framework 'feeding' multiple 
pages. Take a look at the VelocityView servlet within the Velocity Tools 
sub-project at: http://jakarta.apache.org/velocity/tools/view/

- simon

Aaron Freeman wrote:

> I have just installed Velocity and read both the User's Guide and the
> Developer's Guide.  Now I am trying to think through the architecture of my
> site.  I am using Jetty and Servlets so it seems like running Velocity
> within a Servlet is the way to go for me.  What I am not clear is that it
> seems like I am expected to write a servlet for each page that in my
> website.  Is that correct?
> 
> If so, I could always write a fairly fancy servlet that basically implements
> a state machine inside of it.
> 
> Am I missing something?
> 
> Aaron Freeman
> Layer-Z, Inc.
> Phone: (316) 729-9968
> Fax: (215) 895-9813
> aaron@layerz.com
> http://www.layerz.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


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