Steve said:
I am considering replacing a Java applet and have concerns that JSF and Ajax may not be adequate.
Some of the things the applet does is dynamically populate trees, tables, tabs, panes, comboBoxes, etc., on a page based on user
selections on the same page. The applet communicates with the server to get the required data when the information is not
available
at the client. It also presents multiple pages to the user (e.g., JFrames) where info on one page is based upon user selections
on
one or more other pages.
Besides keystroke editing, are there other things I will not be able to do with JSF?
Do you know what problems JSF and Ajax solve?
Browsers forget the GUI state with each page reload. But they reload the entire page every time you click a link submit a form.
This leads to annoying delays, and makes it very difficult to maintain the UI state of complex pages.
JSF is a component-oriented UI framework for the serverside. It takes care of the UI state, and a reliable language and
environment is available to manipute data.
Using AJAX, you can send a request without reloading the whole page, and just replace the changed elements [1]. This eliminates
the delays, and can preserve the UI state completely.
It should be possible to provide the functionality you have outlined with a server side framework in combination with AJAX. But do
you have to use JSF?
In a recent interview [2], Jacob Hookom replied to the question "Do you support Ajax natively?":
| For AJAX, we're planning on pursuing an extension to JSF 1.2 called
| Avatar, based on various EG members' ideas that will allow any and all
| parts of JSF to be used in AJAX applications. [...]
|
| The next revision of JSF (2.0) will probably include a case for a
| "Partial Faces Request" (AJAX). Also, there will probably be more use
| of annotations to ease the component development aspect of the spec.
In plain language: JSF has *no* support for AJAX right now.
I would definitely not try to build an AJAX app using JSF. You might want to read the answers of other developers representing
other java web frameworks. I found them very interesting.
The best java web framework with AJAX support might be Wicket. Have a look at the website [3] and ask for the current state of
AJAX support on the mailing list [4]. AFAIK, there already is Dojo and Scriptaculous support.
Timo
_______
1: Some people misunderstand AJAX as writing the complete application in
Javascript. This is possible, but it has some major drawbacks. The
Javascript implementations are equal, but the DOM implementations are
not. I am not the only one with this opinion:
http://www.loudthinking.com/arc/000428.html
2:
http://www.virtuas.com/files/JavaWebFrameworkSweetSpots.pdf
3:
http://wicket.sourceforge.net/
4:
http://lists.sourceforge.net/lists/listinfo/wicket-user