You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Tavis Rudd <ta...@calrudd.com> on 2001/07/14 04:08:12 UTC

thank you from the Cheetah team

Cheetah is a Python-powered template engine and code 
generator. The Velocity project provided inspiration and 
design ideas. Cheetah has benefitted from the creativity 
and energy of Velocity's developers. Thank you. 

Cheetah was designed for internet development and provides 
integration with Webware (webware.sourceforge.net). 
Together with Webware, Cheetah is a compelling alternative 
to ASP, JSP, PHP and PSP for building dynamic web sites.   
Cheetah can also be used without Webware and is not limited 
to HTML.

Last month, we shifted the development discussions to 
cheetahtemplate-discuss@lists.sourceforge.net and created 
http://www.CheetahTemplate.org.  Cheetah has matured a lot 
since then.  

Version 0.9.7 was released today.  It includes fixes for 
almost all outstanding bugs,  a beefed-up regression test 
suite, and an updated, but still incomplete, Users' Guide.

Cheetah is Open Source Software. Tavis Rudd (me), Mike Orr, 
Chuck Esterbrook, Ian Bicking and Tom Schwaller are the 
core developers. We welcome contributions and suggestions.  
We also welcome any general discussion about Python-based 
templates on the cheetahtemplate-discuss e-mail list.  You 
can subscribe and view the archives at:
http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

More information can be found at 
http://cheetahtemplate.org/

Cheers,
Tavis 

Re: Incorrectly formatted templates

Posted by Kelvin Tan <ke...@relevanz.com>.
Sorry I omitted the fact that I'm using Velocity 1.01.

----- Original Message -----
From: "Kelvin Tan" <ke...@relevanz.com>
To: <ve...@jakarta.apache.org>
Sent: Saturday, July 14, 2001 4:58 PM
Subject: Incorrectly formatted templates


> I've found it somewhat odd that if I don't format my Velocity templates
> correctly in the case of servlets (omitting a #end or using #if(dfdf)
> instead of #if($dfdf)), the error returned is
>
> VelocityServlet : Error processing the template
> java.lang.Exception: handleRequest(Context) returned null - no template
> selected!
> java.lang.Exception: handleRequest(Context) returned null - no template
> selected! at
>
org.apache.velocity.servlet.VelocityServlet.handleRequest(VelocityServlet.ja
> va:561) at
>
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 33) at
>
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at
> org.apache.tomcat.core.Handler.service(Handler.java:287) at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7) at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:213) at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
> at java.lang.Thread.run(Thread.java:484)
>
> Now, is this supposed to be the way it is, or am I not setting something
up
> correctly.
>
> If this is the way it is, I must say the error message is not exactly very
> helpful, since it was more a problem with my template, rather than that
"no
> template (had been) selected".
>
> Thanks.
>
>


Re: Incorrectly formatted templates

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Yes... in Velocity 1.1, there are two handleRequest() methods.  The
better one to use is
handleRequest( HttpServletRequest, HttpServletResponse, Context)...


The thing to make sure you do in handleRequest() is catch the Exceptions
from getTemplate() - that is where the parsing would be done, so you
would then know if you had a syntax problem, and could then take steps
to deal with it.

Take a look a the Javadoc to see what getTemplate() will throw.

geir


Kelvin Tan wrote:
> 
> I've found it somewhat odd that if I don't format my Velocity templates
> correctly in the case of servlets (omitting a #end or using #if(dfdf)
> instead of #if($dfdf)), the error returned is
> 
> VelocityServlet : Error processing the template
> java.lang.Exception: handleRequest(Context) returned null - no template
> selected!
> java.lang.Exception: handleRequest(Context) returned null - no template
> selected! at
> org.apache.velocity.servlet.VelocityServlet.handleRequest(VelocityServlet.ja
> va:561) at
> org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
> 33) at
> org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at
> org.apache.tomcat.core.Handler.service(Handler.java:287) at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
> 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:213) at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
> at java.lang.Thread.run(Thread.java:484)
> 
> Now, is this supposed to be the way it is, or am I not setting something up
> correctly.
> 
> If this is the way it is, I must say the error message is not exactly very
> helpful, since it was more a problem with my template, rather than that "no
> template (had been) selected".
> 
> Thanks.

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

Incorrectly formatted templates

Posted by Kelvin Tan <ke...@relevanz.com>.
I've found it somewhat odd that if I don't format my Velocity templates
correctly in the case of servlets (omitting a #end or using #if(dfdf)
instead of #if($dfdf)), the error returned is

VelocityServlet : Error processing the template
java.lang.Exception: handleRequest(Context) returned null - no template
selected!
java.lang.Exception: handleRequest(Context) returned null - no template
selected! at
org.apache.velocity.servlet.VelocityServlet.handleRequest(VelocityServlet.ja
va:561) at
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java:3
33) at
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java:294)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at
org.apache.tomcat.core.Handler.service(Handler.java:287) at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213) at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

Now, is this supposed to be the way it is, or am I not setting something up
correctly.

If this is the way it is, I must say the error message is not exactly very
helpful, since it was more a problem with my template, rather than that "no
template (had been) selected".

Thanks.


Re: Why a singleton pattern?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Dan Kha wrote:
> 
> Hi,
> 
> I'm just curious, why does velocity use a singleton design pattern (pros,
> cons)?

That was the way it started.  It works very well, as services for the
subcomponents are immediately available.  The cons are obvious :)

> 
> Are there plans to change it?  I guess I find it weird to include the
> velocity.jar in every webapp's lib directory.

I am working on that as we speak. Really.  This is my current mission...
I hope to have something soon.

I actually prefer putting a vel jar in every WEB-INF/lib.  I don't have
any shared jars if I can help it, because then I know that my webapp is
portable anywhere - it doesn't depend upon the explicit classpath, or
the implicit one you get when you drop a jar in the containers /lib.

Also, it means I can experiment / upgrade jars a will in individual
webapps w/o fear of interferance between them.

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

Why a singleton pattern?

Posted by Dan Kha <da...@YorkU.CA>.
Hi,

I'm just curious, why does velocity use a singleton design pattern (pros,
cons)?

Are there plans to change it?  I guess I find it weird to include the
velocity.jar in every webapp's lib directory.

Thanks,
dan


Re: Standard library

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> We just implemented few methods for text formatting, current time and date,
> and
> escaping of HTML code (e.g. change "a > 7" to "a &gt; 7"). Nothing really
> significant.
> 

If you want to contribute them, that would be great.  But of course,
that isn't often possible when developed in a commercial setting, do no
worries if its not possible - just know that contributions are always
welcome.

> How do you see this library from the template user's view point? Will
> it be just a set of independent library objects $mylib.method1(),
> $hislib.method2()
> etc ? What about having a single staring point with some plug in mechanism
> such
> as $lib.mylib1.method1(), $lib.hislib.method2(), etc ?
> 

Well....  We could have some sort of light organization, but I
personally really believe, strongly, that this isn't the business of the
template engine to do this.  Really strongly.  (Our WebMacro bretheren
don't agree, I will note...)

The reason is that this is really the domain of the application, or even
better, the web application framework (like Turbine) that you use to
build your webapp.  

> Having some standard or a framework for the library will make it
> easier to integrate contribution from multiple people.

Yep - in Jakarta there are two, Turbine, which offers excellent support
for Velocity as well as other view technologies, and Struts, which is
more JSP centric although Velocity will work there too.

geir

Y> 
> > -----Original Message-----
> > From: gmj@mta4.srv.hcvlny.cv.net [mailto:gmj@mta4.srv.hcvlny.cv.net]On
> > Behalf Of Geir Magnusson Jr.
> > Sent: Friday, July 13, 2001 7:44 PM
> > To: velocity-user@jakarta.apache.org
> > Subject: Re: Standard library
> >
> >
> > Tal Dayan wrote:
> > >
> > > Is there a standard library for Velocity templates for common operations
> > > such as
> > > getting the current date, printing a string to stdout, string
> > > processing, etc ?
> >
> > In velocity, they wouldn't be templates, but 'tools' to put into the
> > context.  We got a few submissions from users and I put them into the
> > Jakarta Commons sandbox, under the mysterious name 'Rupert'.  (I chose
> > rupert because we didn't have a name... :)
> >
> > So thats a start - if you want to use them, grab them.  If you want to
> > start working on the project of organizing and developing more tools,
> > please do.  Take a look and give a shout back here or on the Jakarta
> > commons list.
> >
> > geir
> >
> > --
> > 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!
> >

-- 
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: Standard library

Posted by Tal Dayan <ta...@zapta.com>.
We just implemented few methods for text formatting, current time and date,
and
escaping of HTML code (e.g. change "a > 7" to "a &gt; 7"). Nothing really
significant.

How do you see this library from the template user's view point? Will
it be just a set of independent library objects $mylib.method1(),
$hislib.method2()
etc ? What about having a single staring point with some plug in mechanism
such
as $lib.mylib1.method1(), $lib.hislib.method2(), etc ?

Having some standard or a framework for the library will make it
easier to integrate contribution from multiple people.

Tal


> -----Original Message-----
> From: gmj@mta4.srv.hcvlny.cv.net [mailto:gmj@mta4.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> Sent: Friday, July 13, 2001 7:44 PM
> To: velocity-user@jakarta.apache.org
> Subject: Re: Standard library
>
>
> Tal Dayan wrote:
> >
> > Is there a standard library for Velocity templates for common operations
> > such as
> > getting the current date, printing a string to stdout, string
> > processing, etc ?
>
> In velocity, they wouldn't be templates, but 'tools' to put into the
> context.  We got a few submissions from users and I put them into the
> Jakarta Commons sandbox, under the mysterious name 'Rupert'.  (I chose
> rupert because we didn't have a name... :)
>
> So thats a start - if you want to use them, grab them.  If you want to
> start working on the project of organizing and developing more tools,
> please do.  Take a look and give a shout back here or on the Jakarta
> commons list.
>
> geir
>
> --
> 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: Standard library

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tal Dayan wrote:
> 
> Is there a standard library for Velocity templates for common operations
> such as
> getting the current date, printing a string to stdout, string
> processing, etc ?

In velocity, they wouldn't be templates, but 'tools' to put into the
context.  We got a few submissions from users and I put them into the
Jakarta Commons sandbox, under the mysterious name 'Rupert'.  (I chose
rupert because we didn't have a name... :)

So thats a start - if you want to use them, grab them.  If you want to
start working on the project of organizing and developing more tools,
please do.  Take a look and give a shout back here or on the Jakarta
commons list.

geir

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

Standard library

Posted by Tal Dayan <ta...@zapta.com>.
Is there a standard library for Velocity templates for common operations
such as
getting the current date, printing a string to stdout, string
processing, etc ?

Thanks

Tal


Re: thank you from the Cheetah team

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Tavis Rudd wrote:
> 
> Cheetah is a Python-powered template engine and code
> generator. The Velocity project provided inspiration and
> design ideas. Cheetah has benefitted from the creativity
> and energy of Velocity's developers. Thank you.
> 

Cool - I remember talking a little with some of the developers trying to
work out how we can move toward a common template language so templates
are portable.  Anything come out along those lines?  ( I will give it a
look...)

> Cheetah was designed for internet development and provides
> integration with Webware (webware.sourceforge.net).
> Together with Webware, Cheetah is a compelling alternative
> to ASP, JSP, PHP and PSP for building dynamic web sites.
> Cheetah can also be used without Webware and is not limited
> to HTML.
> 
> Last month, we shifted the development discussions to
> cheetahtemplate-discuss@lists.sourceforge.net and created
> http://www.CheetahTemplate.org.  Cheetah has matured a lot
> since then.
> 
> Version 0.9.7 was released today.  It includes fixes for
> almost all outstanding bugs,  a beefed-up regression test
> suite, and an updated, but still incomplete, Users' Guide.
> 
> Cheetah is Open Source Software. Tavis Rudd (me), Mike Orr,
> Chuck Esterbrook, Ian Bicking and Tom Schwaller are the
> core developers. We welcome contributions and suggestions.
> We also welcome any general discussion about Python-based
> templates on the cheetahtemplate-discuss e-mail list.  You
> can subscribe and view the archives at:
> http://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
> 
> More information can be found at
> http://cheetahtemplate.org/
> 
> Cheers,
> Tavis

Congratulations. 

geir


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