An example of Velocity application
keywords : Java, JSP, Servlet, template, templates, Apache, Jakarta, Velocity
Reader Requirements : Understanding Java Servlet Basic Concepts
Velocity is a general-purpose, java-based template tool that comes from jakarta.apache.org.
Velocity is a reference to the velocity--Java Web development technology . Here is an example of its application.
This example refers to the structure of the Php-nuke, where all HTTP requests are processed in http://www.some.com/xxx/Modules?name=xxx&arg1=xxx&bbb=xxx form. All files in the example are. java and. html, and there are no other special file formats. In addition to the Modules.java is the Java Servlet, the rest of the. java files are normal Java Class.
All HTTP requests are processed by Modules.java. Modules.java loads modules.htm by Velocity. Modules.htm has a page header, footer, page left navigation links, the content of several parts of the page. Where the page header ads, the content of the page is part of the change. The page header ad is processed by Modules.java, and the content in the page is processed by Modules.java Dispatch to the child page class.
1) Modules.java
Import Javax.servlet.*;import javax.servlet.http.*;import Org.apache.velocity.*;import Org.apache.Velocity.context . *;import Org.apache.velocity.exception.*;import Org.apache. Velocity