Mastering Apache Velocity

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

A comprehensive tutorial on how to use the power of Velocity 1.3 to build Web sites and generate contentDesigned to work hand-in-hand with Apache Turbine, Struts, and servlets, Velocity is a powerful template language that greatly enhances the developer's ability to customize Web sites. It separates Java code from the Web pages, making a site more maintainable. Because of this, it is a viable alternative to JSPs and PHP and is expected to become the standard template engine. In addition to its use with Struts and Turbine, Velocity can also be used to generate Java and XML source code, XML schemas, HTML templates, and SQL code.Even with all its promise, finding expert instructions on how to properly program with this language has been difficult. This code-intensive tutorial gives you all the tools you'll need.It begins by quickly bringing you up to speed on all of the Velocity fundamentals and the Velocity Template Language. You'll then learn how to apply Velocity in a variety of areas with the help of richly detailed code examples. Additionally, you'll be taken through the steps of building a complete application in order to see how you can utilize all of the techniques and technologies discussed in the book. Covering the latest features of Velocity 1.3, Mastering Apache Velocity shows you how to: * Build Java-based Web sites with Struts, servlets, Turbine, and other open-source tools * Generate a wide variety of Web content and code, including Java, XML, SQL, and Postgres

Author(s): Jim Cole, Joseph D. Gradecki
Series: Java open source library
Publisher: Wiley
Year: 2003

Language: English
Pages: 375
City: New York

Cover......Page 2
Contents......Page 6
Introduction......Page 16
Who Should Read This Book......Page 17
Book Organization......Page 18
Static Web Pages......Page 24
Introducing CGI......Page 25
Scripting: JSP/ ASP/ PHP......Page 26
Future Development......Page 27
What’s Next......Page 28
Mixing Presentation and Logic......Page 30
Smalltalk- 80 MVC Triad......Page 33
Extending MVC to Web Applications......Page 36
A Practical MVC......Page 37
What’s Next......Page 39
What Is Velocity?......Page 40
How It Works......Page 41
Velocity Features......Page 44
What’s Next......Page 45
Prerequisites......Page 46
Obtaining Velocity......Page 47
Velocity Versions......Page 50
Testing the Velocity Installation......Page 53
Running the Examples......Page 54
What’s Next......Page 58
Hello World!......Page 60
What’s Next......Page 67
Using Templates......Page 68
The Context......Page 72
Putting the Pieces Together......Page 73
What's Next......Page 78
Reference Types......Page 80
Formal Reference Notation......Page 93
Quiet Notation......Page 94
Escaping References......Page 95
What’s Next......Page 99
#stop......Page 100
#include......Page 103
#parse......Page 106
#set......Page 108
#end......Page 116
#if......Page 117
#else......Page 119
#elseif......Page 120
#foreach......Page 123
Escaping Directives......Page 128
What’s Next......Page 130
Argument Passing......Page 132
Inline vs. Library Macros......Page 137
Velocimacro Properties......Page 138
Nesting and Recursion......Page 140
What’s Next......Page 141
Initializing the Runtime Configuration......Page 142
More Velocity Properties......Page 146
Resource Loaders......Page 152
Events......Page 153
Context Chaining......Page 156
Managing Whitespace......Page 157
What’s Next......Page 160
Accessing XML in Velocity Templates......Page 162
Velocity and Anakia......Page 165
Outputting XML Using Velocity......Page 173
What’s Next......Page 177
Using Servlets......Page 178
Creating an MVC application......Page 183
Advanced Servlet Functionality......Page 198
Adding Reports......Page 201
What’s Next......Page 206
Java Internationalization Components......Page 208
An International CD Web Application......Page 210
What’s Next......Page 216
What Is Turbine?......Page 218
The Turbine Architecture......Page 219
How Does It Work?......Page 223
Obtaining and Installing TDK......Page 224
Your First Turbine Application......Page 226
Dissecting the Application......Page 229
Advanced Velocity in Turbine......Page 243
What’s Next......Page 245
Using Velocity and Maverick......Page 246
How Maverick Works......Page 247
Downloading and Installing Maverick......Page 249
The Maverick Hello World......Page 252
Velocity and Maverick......Page 257
What’s Next......Page 269
IntelliJ's IDEA......Page 270
UltraEdit......Page 273
JEdit......Page 274
Emacs......Page 275
What’s Next......Page 276
Introducing Struts......Page 278
Installing Struts......Page 279
A Sample Application......Page 280
What's Next......Page 289
The Hotel Specifications......Page 292
The Hotel Architecture......Page 293
The Hotel Database Schema......Page 294
Configuring the Maverick XML......Page 295
The Look and Feel Frame......Page 297
Building the Welcome Pages......Page 300
Searching for a Room......Page 303
Booking a Room......Page 313
Looking up a Room......Page 316
What's Next......Page 321
The Velocity Taglib......Page 322
What’s Next......Page 326
Obtaining and Installing DVSL......Page 328
Creating a Simple Transformation......Page 329
Using Nodes......Page 332
The DVSL Toolbox......Page 333
Using the Command Line......Page 336
org. apache. velocity. Template......Page 338
org. apache. velocity. anakia. AnakiaElement......Page 339
org. apache. velocity. anakia. AnakiaTask......Page 340
org. apache. velocity. anakia. NodeList......Page 341
org. apache. velocity. app. FieldMethodizer......Page 343
org. apache. velocity. app. Velocity......Page 344
org. apache. velocity. app. VelocityEngine......Page 345
org. apache. velocity. app. event. EventCartridge......Page 346
Handler......Page 347
org. apache. velocity. app. tools. VelocityFormatter......Page 348
VelocityAutoAlternator......Page 349
org. apache. velocity. context. Context......Page 350
AdapterImpl......Page 351
org. apache. velocity. context. VMContext......Page 352
org. apache. velocity. convert. WebMacro......Page 353
org. apache. velocity. exception. VelocityException......Page 354
org. apache. velocity. io. VelocityWriter......Page 355
org. apache. velocity. servlet. VelocityServlet......Page 356
org. apache. velocity. texen. ant. Texen......Page 357
org. apache. velocity. runtime. RuntimeInstance......Page 358
org. apache. velocity. runtime. RuntimeServices......Page 359
org. apache. velocity. runtime. RuntimeSingleton......Page 361
Manager......Page 363
Manager. MacroEntry......Page 364
Jakarta Velocity Sites......Page 366
Tutorials......Page 367
Applications......Page 368
Index......Page 370