Apache Click | |
Developer: | Apache Software Foundation |
Discontinued: | Yes |
Latest Release Version: | 2.3.0 |
Latest Release Date: | [1] |
Operating System: | Cross-platform |
Programming Language: | Java |
Genre: | Web application framework |
License: | Apache License 2.0 |
Apache Click is a page and component oriented web application framework for the Java language and is built on top of the Java Servlet API.
It is a free and open-source project distributed under the Apache license and runs on any JDK installation (1.5 or later).
Click was initially created by Malcolm Edgar as the click.sourceforce.net project in 2003. The project then graduated to an Apache top-level project in November 2009 with Bob Schellink. The project was retired in May 2014.[2]
The main design goals are simplicity, ease of use, performance and scalability. To achieve these goals Click leverages an intuitive page and component oriented design.
Pages and components provide good encapsulation of web concepts and enables rapid application development.
Click takes a pragmatic approach and expose few abstractions to learn and understand. The Java Servlet API is fully exposed to the developer which eases the upgrade path from an action based framework to a component based one.
Pages and components are developed in Java while templates can be written in Velocity, FreeMarker or JSP. Components know how to draw themselves alleviating developers from maintaining redundant markup.
A major difference between Click and other component oriented web frameworks is that Click is stateless by design, although stateful pages are supported.
There are a number of other component oriented frameworks available for Java such as JSF, Tapestry, WebObjects, Apache Wicket and Vaadin.
Some developers prefer the more traditional action-based web frameworks including Apache Struts, Spring MVC, and Stripes.
A Hello World Click application, with four files:
$message
import org.apache.click.Page;
public class HelloWorld extends Page
click.xml
configuration file. This file specifies the application pages, headers, the format object and the applications mode.
HelloWorld
page class maps to the template hello-world.htm
. We only have to inform Click of the package of the HelloWorld
class, in this case org.wikipedia.click
. We do that through the click.xml
configuration file which allows Click to map hello-world.htm
requests to the org.wikipedia.click.HelloWorld
page class.
ClickServlet
will attempt to load the application configuration file using the path: /WEB-INF/click.xml