velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Barbara Baughman <baugh...@utdallas.edu>
Subject RE: where to find example with dynamic xml transform
Date Tue, 19 Mar 2002 18:07:26 GMT
Velocity comes with documentation and examples.  It is necessary to have
references about Http Servlets and Java, but it seems you already have
that.  The principals behind the VelocityServlet really just extend
HttpServlet a bit and wouldn't fill a book.  The same can be said for the
templating language, which is designed to be uncomplicated enough for a
non-programmer.  You don't design your overall web application any
differently (well, maybe you'll simplify it), you only use a different set
of tools.  

Using Velocity has no comparison to the complexity of JSP.  For JSP, you
need a good fat reference book.  I think that is a great recommendation
for using Velocity!

Velocity is like an HttpServlet, except:
   The init() process is different.  You'll have a velocity.properties
file that you'll have to integrate properly.  If you have difficulties, it
is most likely to be in this step.
   In the servlet, you will only populate Velocity Context object(s) with
the information required by the template instead of trying to build the
entire web page and figure out how to link all the pieces.  The context
together with the template name determine what is sent back to the web
client in the HandleRequest() method.
  The designer takes care of how everything will look to the web client by
writing templates.  The programmer coordinates with the web designer on
what information is needed for each template, making a clear break between
controller and view for the MVC model.  The programmer doesn't need to
know anything about what the web application will look like.  The designer
doesn't need to know anything about how to get the information; it's just
magically there when the template is called (good programming is
indistinguishable from magic).

All of these differences are well documented on the Velocity site and in
the html documentation and examples that accompany the download.  If you
have difficulties, this list is an excellent source for help.

So if you're looking for some big, fat reference book only on Velocity,
you'll have a long wait.  It's not complicated enough for a publisher or
technical writer to bother with it.  Try Velocity  -- you'll like it.

Geir - there is a PR point here, though.  Maybe you could ask O'Reilly to
publish your documentation instead of giving it away for free.  Some folks
would be more impressed, and you'd get some royalties! (;-)  Even more
practical, perhaps you could contact O'Reilly about writing a chapter that
would fit into a larger reference book about how to accomplish the
principles of web design or MVC using Velocity.  In your spare time ....

Barbara Baughman
X2157

On Tue, 19 Mar 2002, Craig Cothren wrote:

> I'm serious and I'm sorry if I stated it poorly.
> 
> I'm having a hard time making a corporate mandated shift from JSP/XSLT based
> MVC to Velocity.  I taught myself JSP/XSLT from a couple of O'Reilly
> Nutshell books several months ago.  I learn best by finding examples and
> expanding upon them.
> 
> I'm also having a hard time finding reference material and examples of
> Velocity... VTL and now DVSL.  I assume that I'm looking in the wrong place.
> Where would you suggest I look for learning aids.
> 
> - Craig
> 
> > ----------
> > From: 	Geir Magnusson Jr.
> > Reply To: 	Velocity Users List
> > Sent: 	Tuesday, March 19, 2002 8:16 AM
> > To: 	velocity-user@jakarta.apache.org
> > Subject: 	Re: where to find example with dynamic xml transform
> > 
> > On 3/19/02 10:58 AM, "Craig Cothren" <CCothren@openlatitude.com> wrote:
> > 
> > > Forgive me... but I don't know DVSL and can't find reference material to
> > > learn it (amazon result of search = 0, o'reilly result of search = 0).
> > 
> > <sigh>
> > 
> > Are you saying that the only valid tools you use are those where you can
> > buy
> > books at Amazon or O'Reilly?
> > 
> > Do you use Ant?
> > 
> > I can't decide if you are serious or trolling.  I am going to give you the
> > benefit of the doubt.
> > 
> > > 
> > > So I'm hoping some one else can provide an example or a URL of how you
> > would
> > > "easily write a little program using DVSL to do this".
> > 
> > http://jakarta.apache.org/velocity/dvsl/index.html
> > 
> > Remember, this is a new tool that's still in development and maturing.
> > 
> > As for the example :
> > 
> > public class Foo
> > {
> > 
> >   public static void main(String[] args)
> >        throws Exception
> >   {
> >         DVSL dvsl = new DVSL();
> >         dvsl.setStylesheet("mystyle.dvsl");
> > 
> >         Reader in = //dunamic XML here
> >         Writer out = new FileWriter("output.html");
> > 
> >         dvsl.transform( in, out );
> > 
> >         out.flush();
> >         out.close();
> >   }
> > 
> > You fill in the "dynamic XML here".
> > 
> > geir
> > 
> > 
> > -- 
> > Geir Magnusson Jr.                                     geirm@optonline.net
> > System and Software Consulting
> > 
> > Age and treachery will always triumph over youth and talent
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> > <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:velocity-user-help@jakarta.apache.org>
> > 
> > 
> 
> --
> To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>
> 
> 


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