You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by One Way <on...@yahoo.com> on 2001/07/15 09:23:10 UTC

'Compiling' Velocity pages

Is there a way to 'compile' a Velocity page (for the purpose of
verifying it for errors) without loading the page in to the browser?

Thanks in advance

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Re: 'Compiling' Velocity pages

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> Since there was no other answer, let me try to answer it though I
> am definitely not a Velocity expert.
> 
> You can always instantiate a template with some 'typical' context and
> execute it. If there was no exception, you may consider it as a 'go'. Then
> you can iterate all the templates in your collection and test them
> one by one.
> 

Good answer - however, if all you want to do is verify the syntax, then
you don't even need to worry abou the context - just do a getTemplate()
on every template you care about, and it will be parsed...

geir

> The trick is to be able to construct a typical context for each of the
> template in your collection.
> 
> Does this make sense ?
> 
> Tal
> 
> > -----Original Message-----
> > From: One Way [mailto:oneway_111@yahoo.com]
> > Sent: Sunday, July 15, 2001 12:23 AM
> > To: velocity-user@jakarta.apache.org
> > Subject: 'Compiling' Velocity pages
> >
> >
> > Is there a way to 'compile' a Velocity page (for the purpose of
> > verifying it for errors) without loading the page in to the browser?
> >
> > Thanks in advance
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
> >

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

RE: 'Compiling' Velocity pages

Posted by Tal Dayan <ta...@zapta.com>.
Since there was no other answer, let me try to answer it though I
am definitely not a Velocity expert.

You can always instantiate a template with some 'typical' context and
execute it. If there was no exception, you may consider it as a 'go'. Then
you can iterate all the templates in your collection and test them 
one by one.

The trick is to be able to construct a typical context for each of the 
template in your collection.

Does this make sense ?

Tal

> -----Original Message-----
> From: One Way [mailto:oneway_111@yahoo.com]
> Sent: Sunday, July 15, 2001 12:23 AM
> To: velocity-user@jakarta.apache.org
> Subject: 'Compiling' Velocity pages
> 
> 
> Is there a way to 'compile' a Velocity page (for the purpose of
> verifying it for errors) without loading the page in to the browser?
> 
> Thanks in advance
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>