click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject Click Services
Date Sat, 27 Apr 2013 13:51:00 GMT
Hi all,

With HTML5 a new breed of applications have become common, the so called single-page apps,
where the 
client side is written entirely in Javascript using jQuery, Dojo, Mootools etc. The server
is used 
to fetch data, through JSON.

GWT is a possible choice for Java devs, however using Java for heavy client side apps is a
clunky. Google also seems to have abandoned GWT and moved resources to Dart.

Click is mostly concerned with responding to requests with HTML code so it isn't a good fit
these single-page apps.

Most of these single-page apps use Rest frameworks as the backend.

I've been wondering if it is worth adding a Service concept to Click that can be used to serve
JSON/XML etc to single-page apps. The Service would be a first class citizen similar to Page,
only with the onInit lifecycle method. Other public methods is for handling the request eg:

class MyService {

     public void onInit() {
       // Only lifecycle method?

     public ActionResult getPersonData() {

     public ActionResult savePersonData() {

I'm not thinking of a Rest based architecture here, simply a JSON/XML over HTTP service layer.

ClickServlet might also have to be refactored into a Filter for more flexible URL mappings.

On the other hand this might just be reinventing the wheel. One thing which would be nice
with Click 
(compared to the other Rest frameworks) is our integration with Velocity.


Kind regards


View raw message