JEE Custom Search Portals

Thursday, November 18, 2010


Apache Click in a Click - Part 1 [General Overview]

Apache Click is another JEE web application framework similar to Apache Wicket and Struts. The initial version of Apache Click started in 2003 and there were constant improvements happening for this framework through the years. Now the framework has become very mature and in my view, it is ready to be used in Production applications.

Apache Click is a modern JEE web application framework providing a rich client style programming model. Apache Click is an open source project and this uses an event based programming model for processing Servlet requests and Velocity for rendering the response.

The advantages of Apache Click are: 
  1. Easy to learn 
  1. Component and Page Oriented design
  • Click provides a page oriented design featuring control components and an event based programming model
  • There are over 40 controls that comes along with the click distribution which we can readily use in our applications. The controls are divided into 2: 
    • Core Controls:  For example, ActionLink, ActionButton, Checkbox etc.
    • Extra Controls:  For example, CreditCardField, TelephoneField, EmailField etc.
  • Very easy to develop and deploy our own custom controls too. For example, a Scrollable data table etc.
  1. Stateless and stateful page support
  • Click provides support for implementing stateless pages. Stateless pages can be marked as stateless if it doesn't have any callbacks to itself. It doesn't care about saving the state of the page for any reason. 
    • Examples of stateless pages are bookmarks, login page etc.
  • Click provides support for implementing stateful pages. Stateful pages can be marked as stateful since it saves the state of the page between the user requests.   
    • Examples of stateful pages are wizard kind of pages where in the user has to complete the different steps in different pages to complete a flow. The user will also have the option to go back and forth between pages and also save in between without completing the full flow.
  1. Automatic form rendering and client/server side validation
  • Click provides Forms and controls which will help us in automatic form rendering and validation and it also helps in making the development faster and error free. 
  1. Supports Velocity, JSP or FreeMarker page rendering
  • By default, click uses Velocity for rendering the pages. It uses Velocity because of the following reasons - 
    • Velocity is a proven templating mechanism
    • Velocity has very simple instruction set for usage and it is very easy to learn.
  • Click also provides support for using other templating mechanism like FreeMarker and the very well known and widely used JSP.   
As a next step, the next part of the blog will be detailing about the servlet's [ClickServlet] loading life cycle.

No comments:

Post a Comment