An example of Velocity application

Source: Internet
Author: User
Tags java web

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.