Velocity Introduction

Velocity is based on a Java template engine, it is a simple and powerful development tools, you can easily create and exhibit. In this presentation which, we hope to give a basic use Velocity outlined.

Use Velocity to build Web applications

Velocity is often used to build Web applications, in order to Web use applications Velocity , requires a servlet or on a servlet framework. The easiest way is to use the Velocity Tools subproject VelocityViewServlet . Of course, you can also use other third-party or build their own framework the servlet .

We recommend that you read <Web application entry > this article, the specific content of which will have more choices.

Download Velocity

You can Apache Velocity download the latest Master Release version of Velocity and Velocity Tools . Velocity source code is also included in the compiled binaries.

If you want to download the latest version of the source code, you can svn to download its source code management system, or download a complete snapshot (Snapshot) .

In the construction of the document will explain how to how to build source code form by Velocity .

rely

Velocity using Java2 the API of some elements, such as collection, it is built on Java2 Standard Edition SDK on. Want Velocity normal operation, is the need for Java2 Standard Edition operating environment.

Velocity also on some of the functionality of the package. For ease of use, they are put into the build / lib directory, but the default compiler does not contain them. If you use it, you need to add these packages to depend on the project path.

  • Jakarta Commons Collections - must
  • Jakarta Commons Lang - must
  • Excalibur (ex-Avalon) Logkit - Alternatively, very common. In Velocity default in a log file.
  • Jakarta ORO - optional. When org.apache.velocity.convert.WebMacro template conversion function or use org.apache.velocity.app.event.implement.EscapeReference in ReferenceInsertionEventHandler time, you need to add the references.

Reproduced in: https: //my.oschina.net/secyaher/blog/274498

Guess you like

Origin blog.csdn.net/weixin_33953249/article/details/91967143