Pros & Cons of JSF/Ajax

Discussion in 'Java' started by Steve, Apr 8, 2006.

  1. Steve

    Steve Guest

    I need to build a very dynamic client and would be interested in knowing the pros and
    cons of using JSF and Ajax to accomplish this.

    Thanks.

    Steve
    Steve, Apr 8, 2006
    #1
    1. Advertising

  2. Steve

    Roedy Green Guest

    On Sat, 08 Apr 2006 21:10:56 GMT, "Steve" <> wrote, quoted or
    indirectly quoted someone who said :

    >I need to build a very dynamic client and would be interested in knowing the pros and
    >cons of using JSF and Ajax to accomplish this.


    The biggest problem with Ajax is you have a different JavaScript
    implementation in every browser with different bugs and different
    proprietary extensions. You also are then limited to browsers with
    JavaScript.

    JSF on the other hand is not going to be able to pull off clever
    client side tricks like keystroke editing.

    If you have a captive audience all using the same browser and version,
    Ajax looks better. If you have the general public as your audience
    then JSF looks better.

    Obviously there are many other factors to consider.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Apr 8, 2006
    #2
    1. Advertising

  3. Steve

    Steve Guest

    Roedy,

    Thank you for your reply.

    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? In particular, do the above sound doable or
    might I have some problems?

    Thanks for any feedback.

    Steve
    --

    "Roedy Green" <> wrote in message news:...
    > On Sat, 08 Apr 2006 21:10:56 GMT, "Steve" <> wrote, quoted or
    > indirectly quoted someone who said :
    >
    >>I need to build a very dynamic client and would be interested in knowing the pros and
    >>cons of using JSF and Ajax to accomplish this.

    >
    > The biggest problem with Ajax is you have a different JavaScript
    > implementation in every browser with different bugs and different
    > proprietary extensions. You also are then limited to browsers with
    > JavaScript.
    >
    > JSF on the other hand is not going to be able to pull off clever
    > client side tricks like keystroke editing.
    >
    > If you have a captive audience all using the same browser and version,
    > Ajax looks better. If you have the general public as your audience
    > then JSF looks better.
    >
    > Obviously there are many other factors to consider.
    > --
    > Canadian Mind Products, Roedy Green.
    > http://mindprod.com Java custom programming, consulting and coaching.
    Steve, Apr 8, 2006
    #3
  4. Steve

    Timo Stamm Guest

    Steve schrieb:
    > 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
    Timo Stamm, Apr 9, 2006
    #4
  5. Steve

    Roedy Green Guest

    On Sat, 08 Apr 2006 22:54:04 GMT, "Steve" <> wrote, quoted or
    indirectly quoted someone who said :

    >Besides keystroke editing, are there other things I will not be able to do with JSF? In particular, do the above sound doable or
    >might I have some problems?


    Vanilla HTML does not have much in the way of smarts. the Form and
    table is about as clever at is gets.

    You might also consider JAWS. see
    http://mindprod.com/jgloss/javawebstart.html

    What the disadvantages of signed Applet for you?
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Apr 9, 2006
    #5
  6. Steve

    Steve Guest

    Thanks for your comments.

    I constructed a prototype using a signed applet but my customer is concerned about deploying JREs to all the client workstations.
    They suggested JSF as a possible alternative but I am concerned about using a server-side solution when a highly dynamic client is
    needed.

    Steve

    --

    "Timo Stamm" <> wrote in message news:4438665a$0$18264$-online.net...
    > Steve schrieb:
    >> 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
    Steve, Apr 9, 2006
    #6
  7. Steve

    Steve Guest

    Thanks for your comments.

    My customer has concerns about deploying JREs to all the client workstations and the maintenance involved. They have asked about
    alternatives and suggested JSF with Ajax as a possibility. The environment is currently Tomcat (with JSPs), Spring, Hibernate, etc.

    Steve

    BTW, The prototype I showed them is a signed applet.

    "Roedy Green" <> wrote in message news:...
    > On Sat, 08 Apr 2006 22:54:04 GMT, "Steve" <> wrote, quoted or
    > indirectly quoted someone who said :
    >
    >>Besides keystroke editing, are there other things I will not be able to do with JSF? In particular, do the above sound doable or
    >>might I have some problems?

    >
    > Vanilla HTML does not have much in the way of smarts. the Form and
    > table is about as clever at is gets.
    >
    > You might also consider JAWS. see
    > http://mindprod.com/jgloss/javawebstart.html
    >
    > What the disadvantages of signed Applet for you?
    > --
    > Canadian Mind Products, Roedy Green.
    > http://mindprod.com Java custom programming, consulting and coaching.
    Steve, Apr 9, 2006
    #7
  8. Steve

    Roedy Green Guest

    On Sun, 09 Apr 2006 14:38:02 GMT, "Steve" <> wrote, quoted or
    indirectly quoted someone who said :

    >My customer has concerns about deploying JREs to all the client workstations and the maintenance involved


    That is really no different that installing any other program. The
    main problem is when talking to the public who may not be permitted to
    install any program in a corporate environment or who may have been
    lied to that Applets are dangerous.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Apr 9, 2006
    #8
  9. Steve

    Chris Guest

    "Steve" <> wrote in message news:AFVZf.2299$XI6.1491@trnddc05...
    >I need to build a very dynamic client and would be interested in knowing
    >the pros and
    > cons of using JSF and Ajax to accomplish this.


    I've got the same issue. My guess is that the best approach is to buy a
    pre-built Ajax framework and use that. That way somebody else has the
    headache of dealing with cross-browser issues, bugs, flaky Javascript, etc.
    This doesn't eliminate the other downsides of Ajax, which include making it
    difficult for search engines to index your pages and losing the "back"
    button, but that may not be a problem for you.

    The question remains: which pre-built framework to use? I do not know which
    ones work well and aren't outrageously expensive.
    Chris, Apr 9, 2006
    #9
  10. Steve

    Tomislav Guest

    Steve wrote:
    > Thanks for your comments.
    >
    > I constructed a prototype using a signed applet but my customer is concerned about deploying JREs to all the client workstations.
    > They suggested JSF as a possible alternative but I am concerned about using a server-side solution when a highly dynamic client is
    > needed.


    I suggest you consider building a regular swing app and deploy it via Java Web
    Start. You can configure it so that it works completely in-memory, so the only
    thing you need is a JRE on every client. One click and a full swing rich
    client - with all it's flexibility and responsiveness, as well as all the IDE
    support for building one - starts up and clients just use it.
    I'd say this approach has a number of advantages over AJAX-based solutions,
    especially in terms of ease of development, reliability and flexibility. AJAX
    development might be going in the right direction, but it's still a long way
    away from everyone's favourite tool for highly interactive web apps...in my
    opinion, anyway.

    t.n.a.
    Tomislav, Apr 11, 2006
    #10
  11. Steve

    Arvind Guest

    Have you tried RICO ? (http://openrico.org/)

    AJAX takes you as far as you'd want to go without a page reload - but
    the grunt work of server side, business logic, persistence etc still
    remains to be addressed - JSF or AJAX does not change that a single
    bit.

    --
    Arvind
    Arvind, Apr 12, 2006
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kumar Vijay Mishra

    PSL pros and cons

    Kumar Vijay Mishra, Sep 29, 2004, in forum: VHDL
    Replies:
    2
    Views:
    2,584
    vhdlcohen
    Oct 2, 2004
  2. Benny
    Replies:
    1
    Views:
    430
    Paul Wistrand
    Mar 1, 2004
  3. Lucas Tam
    Replies:
    3
    Views:
    2,004
    Reza Alirezaei
    Aug 9, 2005
  4. Roedy Green

    pros and cons of Ajax

    Roedy Green, Nov 27, 2010, in forum: Java
    Replies:
    9
    Views:
    637
    Arne Vajhøj
    Nov 28, 2010
  5. Steve

    Pros & Cons of JSF/Ajax

    Steve, Apr 8, 2006, in forum: Javascript
    Replies:
    9
    Views:
    169
    Arvind
    Apr 12, 2006
Loading...

Share This Page