Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 4 - Pages: 1  
  Click to reply to this thread Reply

Click 0.6 J2EE web application framework

URL: http://click.sourceforge.net

At 7:03 AM on Jul 4, 2005, Malcolm Edgar wrote:

Click version 0.6 is now available.

http://click.sourceforge.net

Click Highlights
* Very easy to learn
* Component and Page Oriented design
* Event base programming model
* Automatic form validation
* Page templating
* Velocity page rendering
* Superb error reporting
* High performance

Why Click
What to know why anyone would want to build another web application framework please see Why Click?

http://click.sourceforge.net/docs/why-click.html

Road Map and Changes

http://click.sourceforge.net/docs/roadmap-changes.html


regards Malcolm Edgar
1 . At 12:08 PM on Jul 4, 2005, Alarmnummer DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Click 0.6 J2EE web application framework

It looks interesting. I`m currently looking for a more 'swing' based web framework like Tapestry/JSF (using maverick at the moment). I haven`t looked thoroughly at Simple (but it does look simple) :) and I have skimmed through Click. It looks nice.. page based design, allows components.

But I have some questions:
-how do you deal with page state? With Tapestry this is simple..you can add it to the property description and tapestry does the rest

-how do you deal with interpage calls? With Tapestry I can say:

PersonForm form = (PersonForm)cycle.getPage("PersonForm");
form.initForEdit(john);
cycle.activate(form);

This is a lot better than what I`m used to (Maverick + JSF).

-how easy is it to use 'objects' in html? With tapestry I can register certain classes (like Employee) to be 'serializable' (read object->String/String->Object). Tapestry takes care for translating it to a usable String, and retrieves an object that belongs to a String.

-how easy is it to parametrize calls to page-methods? I know it is easy to use non-parametrized methods in Click.

With tapestry (the newest version: 4) you can write a true method call in the html (and this certainly gives a very good feeling).

-how easy is it to create friendly url`s? With Tapestry this is quite difficult although 4.0 should be better.

These are the most important questions that come to mind at the moment.

remark:
My problem with Tapestry is that it is quite complex. And I`m afraid our developteam will have difficulties using it.
2 . At 8:01 PM on Jul 4, 2005, Malcolm Edgar wrote:
  Click to reply to this thread Reply

Re: Click 0.6 J2EE web application framework

Hi Alamnummer,

Page State
Click doesn't automatically support page state as does Tapestry.

However you will find the Forms and Controls handle their state themselves. For example when a form has been posted, and its not valid, the Form will render itself with the submitted values and the field validation error messages automatically.

The HiddenField control allows you to store serializable Java objects inside a form. Handy for keeping sessions lean.

Interpage Calls

With Click if you want to pass information to a page you have to set a request attribute (when you forward to a page):

public boolean onViewClick() {
Long id = viewLink.getValueLong();
Customer customer = CustomerDAO.findByPK(id);

getContext().setRequestAttribute("customer", customer);
setForward("view-customer.htm");

return false;
}

When you redirect to another page you will need to set a request parameter:

Long transId = PurchaseDAO.insert(purchase);
setRedirect("trans-complete.htm?trans-id=" + transId);

Otherwise you can always pass values as session attributes. Please see the Page navigation topic for details:

http://click.sourceforge.net/docs/pages.html#page-navigation

Please note with Tapestry page there is a hidden danger you need to be aware of. Pages are pooled, and are not recreated with every request. Developers need to ensure they don't setup any object callbacks (action listener style inner classes) to page instances as you might be given an different page instance when processing a later request.

Parameterised Callback Methods

At the moment Click callbacks methods don't support parameters. This was chosen for simplicity.

Clicks initial design used Delphi style callbacks, where the sender is the object invoking the method. From the sender object you can get any parameter info you need:

public boolean onClick(Object sender) { .. }

However I found I rarely ever used the sender parameter, as was the case with Delphi, and I eliminated it for the sake of simplicity (a high priority with Click).

However that said, I would be open to having Click call a method with a Object parameter if available, otherwise calling a no-args method.

Friendly URLs

Click URL's are simple and are compatible with Servlet path based security model.

Simplicity

Many of the features Tapestry has are not present in Click for the sake of simplicity. Click is much eaiser to learn and understand as a result.

Click API has 31 classes and interfaces.

Tapestry API has 680 classes and interfaces.
3 . At 1:57 AM on Jul 5, 2005, Alarmnummer DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Click 0.6 J2EE web application framework

Page State
Click doesn't automatically support page state as does Tapestry.
------------------------------
That is a shame because it helped me to do some complex things very simple.


Interpage Calls

With Click if you want to pass information to a page you have to set a request attribute (when you forward to a page):

public boolean onViewClick() {
Long id = viewLink.getValueLong();
Customer customer = CustomerDAO.findByPK(id);

getContext().setRequestAttribute("customer", customer);
setForward("view-customer.htm");

return false;
}

When you redirect to another page you will need to set a request parameter:

Long transId = PurchaseDAO.insert(purchase);
setRedirect("trans-complete.htm?trans-id=" + transId);

Otherwise you can always pass values as session attributes. Please see the Page navigation topic for details:

---------------------------------------

The interpage calls just made me so happy. In the beginning (Maverick/Tapestry) I had to fiddle around with url`s and parameters and it makes my head hurt. That is why I liked tapestry.. think in objects/methods and not in html/url`s.


Please note with Tapestry page there is a hidden danger you need to be aware of. Pages are pooled, and are not recreated with every request. Developers need to ensure they don't setup any object callbacks (action listener style inner classes) to page instances as you might be given an different page instance when processing a later request.
-----------------------------------------
Yes.. this is something that has to be remembered.

Parameterised Callback Methods

At the moment Click callbacks methods don't support parameters. This was chosen for simplicity.

Clicks initial design used Delphi style callbacks, where the sender is the object invoking the method. From the sender object you can get any parameter info you need:

public boolean onClick(Object sender) { .. }

However I found I rarely ever used the sender parameter, as was the case with Delphi, and I eliminated it for the sake of simplicity (a high priority with Click).

However that said, I would be open to having Click call a method with a Object parameter if available, otherwise calling a no-args method.
------------------------------
I think they are easy to use. It is easy that you can use a method in html and don`t have to do strange things just for sake of using something simple (a lot of simple things are very complex in webpages).

Friendly URLs

Click URL's are simple and are compatible with Servlet path based security model.

------------------------------------
Do you have a single servlet? Tapestry does. and you will get url`s like:
foo?service=Page/Management

(and it will be uglier if you add more and more parameters)

Simplicity

Many of the features Tapestry has are not present in Click for the sake of simplicity. Click is much eaiser to learn and understand as a result.

Click API has 31 classes and interfaces.

Tapestry API has 680 classes and interfaces.
------------------------------
That could be a good thing although it shouldn`t be simpeler than needed. The page state.. hmm.. not that important at the moment. But the interpage calls/method calls on pages are important to me.

But how does your system deal with object->String/String->Object?

If I want to use select (with a select input) a person. How are the persons 'serialized' into the html? And how are the objects restored if you are back in java?
4 . At 7:39 AM on Jul 5, 2005, Malcolm Edgar wrote:
  Click to reply to this thread Reply

Re: Click 0.6 J2EE web application framework

Interpage Calls

I could modify the framework so you could create a new Page instance, which would then be set as a request attribute when forwarding to another page. This would then alow you to:

NextPage nextPage = (NextPage) getContext().createPage("nextpage.htm");

nextPage.setCustomer(customer);

forward("nextpage.htm");


Mmm, I think this is a good idea.

Method Calls

I am not sure if we are talking about the same thing. If you are refering to calling a method directly from your HTML template when rendering, yes Velocity does this really well.

Friendly URLs

Click URLs are very basic, and are layed out in the click.xml configuration file. Each URL path points to a Page class. So you will get things like:

/action-table.htm -> examples.page.ActionTable

An ActionLink URL on this page could be:

/action-table.htm?actionLink=deleteLink&value=2023

Click applications use a single servlet.

Object Serialization

The HiddenField control converts primitive Java Object into string values, while more complex Serializable objects are serialized via:

object -> ObjectOutputStream -> GZIPOutputStream -> ByteArrayOutputStream -> Base64.encode -> string

Deserialization is the reverse of this process.

thread.rss_message