- Apache Click
-
Apache Click Developer(s) Apache Software Foundation Stable release 2.3.0 / March 27, 2011 [1] Written in Java Operating system Cross-platform Type Web application framework License Apache License 2.0 Website http://click.apache.org/ Apache Click is a modern 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 graduated into an Apache top-level project in November 2009.
Contents
Overview
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.
Competing frameworks
There are a number of other component oriented frameworks available for Java such as JSF, Tapestry, WebObjects and Apache Wicket.
Some developers prefer the more traditional action-based web frameworks including Apache Struts, Spring MVC, and Stripes.
Example
A Hello World Click application, with four files:
- hello-world.htm
- The default template engine for Click is Velocity, the htm file will be similar to a normal, static HTML page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <body> <p>$message</p> </body> </html>
- HelloWorld.java
- The page model that will be bound to the template.
package org.wikipedia.click; import org.apache.click.Page; public class HelloWorld extends Page { /** * Constructor */ public HelloWorld() { // Add the value to the map ("message" = "$message") addModel("message", "Hello World!"); } }
- click.xml
- The heart of a Click application is the
click.xml
configuration file. This file specifies the application pages, headers, the format object and the applications mode. - Click is smart enough to figure out that the
HelloWorld
page class maps to the templatehello-world.htm
. We only have to inform Click of the package of theHelloWorld
class, in this caseorg.wikipedia.click
. We do that through theclick.xml
configuration file which allows Click to maphello-world.htm
requests to theorg.wikipedia.click.HelloWorld
page class. - By default the
ClickServlet
will attempt to load the application configuration file using the path:/WEB-INF/click.xml
<?xml version="1.0" encoding="UTF-8"?> <click-app> <pages package="org.wikipedia.click"/> </click-app>
- web.xml
- The servlet application definition.
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>Click Example</display-name> <servlet> <servlet-name>click-servlet</servlet-name> <servlet-class>org.apache.click.ClickServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>click-servlet</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> </web-app>
Bibliography
- Daoud, Frederic (January 4, 2010). Getting Started With Apache Click (1st ed.). pp. 150. http://www.fdaoud.com/clickbook/.
See also
References
External links
- Introduction (Click user guide)
- Get to know Apache Click
- Live Examples
- Apache Click Official blog
- Announcements
- Bob Schellink
- Naoki Takezoe
- ClickIDE - an Eclipse based IDE
Apache Software Foundation Top level projects - Abdera
- ActiveMQ
- Ant
- Aries
- Apache HTTP Server
- APR
- Avro
- Axis
- Buildr
- Camel
- Cassandra
- Cayenne
- Chemistry
- Click
- Cocoon
- Continuum
- CouchDB
- CXF
- Derby
- Directory
- Felix
- Forrest
- Geronimo
- Gump
- Hadoop
- Hive
- HBase
- Jackrabbit
- James
- Karaf
- Lenya
- libcloud
- Mahout
- Maven
- MINA
- mod_perl
- MyFaces
- ODE
- OFBiz
- OpenEJB
- OpenJPA
- POI
- Pivot
- Qpid
- River
- Roller
- ServiceMix
- Shindig
- Shiro
- Sling
- SpamAssassin
- stdcxx
- Struts
- Subversion
- Tapestry
- Thrift
- Tomcat
- Trafficserver
- Tuscany
- UIMA
- Velocity
- Wicket
- Xerces
- XMLBeans
Jakarta Projects Commons Projects - Daemon
- Sanselan
- Jelly
Lucene Projects - Lucene Java
- Droids
- Lucene.Net
- Lucy
- Nutch
- Open Relevance Project
- PyLucene
- Solr
- Tika
Hadoop Projects - HDFS
- ZooKeeper
Other projects Incubator Projects - ACE
- Callback
- Composer
- Empire-db
- Hama
- JSPWiki
- OpenOffice.org
- XAP
- Wink
Apache Attic - License: Apache License
- Website: apache.org
Web application frameworks ASP.NET ASP.NET MVC · ASP.NET Web Forms · ASP.NET Dynamic Data · BFC · DotNetNuke · MonoRail · OpenRasta · UmbracoColdFusion Common Lisp C++ Java Apache Struts · AppFuse · Flexive · GWT · Grails · Vaadin · ItsNat · JavaServer Faces · Jspx · Makumba · OpenXava · Play · Eclipse RAP · Reasonable Server Faces · RIFE · Seam · Spring · Stripes · Tapestry · WebWork · Wicket · ZK · ICEfaces · WaveMakerJavaScript Ample SDK · Prototype JavaScript Framework · Rico · script.aculo.us · SproutCore · jQuery · Dojo ToolkitPerl PHP AppFlower · CakePHP · CodeIgniter · Drupal · e107 · Horde · Joomla! · Lithium · Midgard · MODx · Qcodo · Seagull · SilverStripe · Symfony · TYPO3 · Xaraya · Yii · Zend Framework · Zeta ComponentsPython Ruby Smalltalk Other languages Application Express (PL/SQL) · Fusebox (ColdFusion and PHP) · HAppS (Haskell) · Kepler (Lua) · Lift (Scala) · OpenACS (Tcl) · SproutCore (JavaScript/Ruby) · Yaws (Erlang)Categories:- Java enterprise platform
- Web application frameworks
Wikimedia Foundation. 2010.