You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Adam Koprowski <ad...@gmail.com> on 2006/12/10 15:23:03 UTC

JSF is the answer? I don't think so...

    Hello,
  Approximately one year ago, together with my colleague, we had to make a
decision what technology to use for the development in some project of ours.
At the time, after quick investigation, we came up with the idea of using
J2EE, that is EJB + JSF. Let alone the EJB but let me share with you some
thoughts that I have about JSF after this year of work with it.
  Below you will find a mixture of features (that I would expect any decent
web framework to support) and problems (that I would expect any decent
framework to solve and let developer not worry about it). Here we go:
 -) use of browser back button,
 -) page bookmarking,
 -) double form submission (by double user click),
 -) opening link in new browser tab/window,
 -) having multiple copies of a page/service in different browser
tabs/windows
  Now, correct me if I'm wrong, but I think all of the above pose some (lots
of?) difficulties in JSF. And I know that some of those are not easy issues
(like browser's back button) but personally I think this list is way too
long...
  I don't really know any alternative web frameworks so I cannot compare but
is it really that the developer has to deal with all of those issues on his
own? Or are there frameworks where one does not need to worry about those
irritating problems and can concentrate on real development... and JSF is
just too immature to provide that? I know this is not a myfaces specific
question but I decided to post this provocative question on this list as I'm
curious about your opinion guys...
  Best wishes,
   Adam Koprowski

-- 
=====================================================
Adam.Koprowski@gmail.com , ICQ: 3204612
http://www.win.tue.nl/~akoprows <http://www.win.tue.nl/%7Eakoprows>
The difference between impossible and possible
lies in determination (Tommy Lasorda)
=====================================================

Re: JSF is the answer? I don't think so...

Posted by David Chandler <da...@learnjsf.com>.
The POST-REDIRECT-GET pattern has been very useful for me in solving
problems with the back button and bookmarking. PRG can be applied to
Web apps in any framework, but JSF allows you to solve it centrally
using a phase listener (see below). Or you can use the <redirect>
element in all your navigation cases.

See http://learnjsf.com/wp/2006/08/06/a-prg-phase-listener-for-jsf/
for the code and limitations.

/dmc

I've written a PRG phase listener for JSF

On 12/11/06, Andrew Robinson <an...@gmail.com> wrote:
> Almost all of your issues relate to web pages that are information based
> instead of form based. If you are not submitting data, you should consider
> using all outputLinks instead of commandLinks. That way your pages will be
> bookmark-able and have the ability to open in a new window. If you must use
> commands on non-data data positing events, then use redirect set to true to
> make sure the URL of the browser is updated.
>
> As for the browser back button, it has always worked for me in JSF with
> server side state saving and should work fine with client side state even
> better, what MyFaces version are you using?
>
> Double form submission: this is not a framework issue, it is a user one and
> an HTML one. There are many ways to "fix" this, like disabling the button on
> click, disabling the form after submit, a phase listener that "counts"
> submissions and skips the validation & update phases if a repeat post, etc.
>
> having multiple copies of a page/service in different browser tabs/windows:
> This is not an issue, why is it for you? Just avoid session scope. Use
> request scope plus <t:saveState> or use the JBoss-Seam conversation state
> (which is per window).
>
> -Andrew
>
> On 12/10/06, Adam Koprowski <ad...@gmail.com> wrote:
> >     Hello,
> >   Approximately one year ago, together with my colleague, we had to make a
> decision what technology to use for the development in some project of ours.
> At the time, after quick investigation, we came up with the idea of using
> J2EE, that is EJB + JSF. Let alone the EJB but let me share with you some
> thoughts that I have about JSF after this year of work with it.
> >   Below you will find a mixture of features (that I would expect any
> decent web framework to support) and problems (that I would expect any
> decent framework to solve and let developer not worry about it). Here we go:
> >  -) use of browser back button,
> >  -) page bookmarking,
> >  -) double form submission (by double user click),
> >  -) opening link in new browser tab/window,
> >  -) having multiple copies of a page/service in different browser
> tabs/windows
> >   Now, correct me if I'm wrong, but I think all of the above pose some
> (lots of?) difficulties in JSF. And I know that some of those are not easy
> issues (like browser's back button) but personally I think this list is way
> too long...
> >   I don't really know any alternative web frameworks so I cannot compare
> but is it really that the developer has to deal with all of those issues on
> his own? Or are there frameworks where one does not need to worry about
> those irritating problems and can concentrate on real development... and JSF
> is just too immature to provide that? I know this is not a myfaces specific
> question but I decided to post this provocative question on this list as I'm
> curious about your opinion guys...
> >   Best wishes,
> >    Adam Koprowski
> >
> > --
> > =====================================================
> > Adam.Koprowski@gmail.com , ICQ: 3204612
> > http://www.win.tue.nl/~akoprows
> > The difference between impossible and possible
> > lies in determination (Tommy Lasorda)
> > =====================================================
>
>


-- 
David Chandler
Development Coach
learnjsf.com

Re: JSF is the answer? I don't think so...

Posted by Kevin Galligan <kg...@gmail.com>.
Second on that.  I was struggling with some of the concepts with the
commandLink and whatnot, and missing the days of struts where I'd just stick
an href with an id attached to the query string.  Then it was like somebody
slapped me in the face.  You can still do that, if you want to.  Its just
that, when you read a JSF book, they give you the examples with the new
components and not the plain old href's.  I'm trying to find the happy
medium, but I have found myself doing a mix as my first large app nears
completion.

On 12/11/06, Roger Keays <ro...@ninthavenue.com.au> wrote:
>
> Andrew Robinson wrote:
> > Almost all of your issues relate to web pages that are information based
> > instead of form based. If you are not submitting data, you should
> > consider using all outputLinks instead of commandLinks. That way your
> > pages will be bookmark-able and have the ability to open in a new
> > window. If you must use commands on non-data data positing events, then
> > use redirect set to true to make sure the URL of the browser is updated.
>
> I think people coming to JSF get so swamped with lifecycles, validators,
> converters etc that they forget you can always just put in an ordinary
> <a href="">, or even a plain old <form method="GET"> if you want.
>
> Heck, just make all your pages static HTML and get the default servlet
> to serve them.
>
> >
> > As for the browser back button, it has always worked for me in JSF with
> > server side state saving and should work fine with client side state
> > even better, what MyFaces version are you using?
> >
> > Double form submission: this is not a framework issue, it is a user one
> > and an HTML one. There are many ways to "fix" this, like disabling the
> > button on click, disabling the form after submit, a phase listener that
> > "counts" submissions and skips the validation & update phases if a
> > repeat post, etc.
> >
> > having multiple copies of a page/service in different browser
> tabs/windows:
> > This is not an issue, why is it for you? Just avoid session scope. Use
> > request scope plus <t:saveState> or use the JBoss-Seam conversation
> > state (which is per window).
> >
> > -Andrew
> >
> > On 12/10/06, *Adam Koprowski* <adam.koprowski@gmail.com
> > <ma...@gmail.com>> wrote:
> >
> >         Hello,
> >       Approximately one year ago, together with my colleague, we had to
> >     make a decision what technology to use for the development in some
> >     project of ours. At the time, after quick investigation, we came up
> >     with the idea of using J2EE, that is EJB + JSF. Let alone the EJB
> >     but let me share with you some thoughts that I have about JSF after
> >     this year of work with it.
> >       Below you will find a mixture of features (that I would expect any
> >     decent web framework to support) and problems (that I would expect
> >     any decent framework to solve and let developer not worry about it).
> >     Here we go:
> >      -) use of browser back button,
> >      -) page bookmarking,
> >      -) double form submission (by double user click),
> >      -) opening link in new browser tab/window,
> >      -) having multiple copies of a page/service in different browser
> >     tabs/windows
> >       Now, correct me if I'm wrong, but I think all of the above pose
> >     some (lots of?) difficulties in JSF. And I know that some of those
> >     are not easy issues (like browser's back button) but personally I
> >     think this list is way too long...
> >       I don't really know any alternative web frameworks so I cannot
> >     compare but is it really that the developer has to deal with all of
> >     those issues on his own? Or are there frameworks where one does not
> >     need to worry about those irritating problems and can concentrate on
> >     real development... and JSF is just too immature to provide that? I
> >     know this is not a myfaces specific question but I decided to post
> >     this provocative question on this list as I'm curious about your
> >     opinion guys...
> >       Best wishes,
> >        Adam Koprowski
> >
> >     --
> >     =====================================================
> >     Adam.Koprowski@gmail.com <ma...@gmail.com>, ICQ:
> 3204612
> >     http://www.win.tue.nl/~akoprows <http://www.win.tue.nl/%7Eakoprows>
> >     The difference between impossible and possible
> >     lies in determination (Tommy Lasorda)
> >     =====================================================
> >
> >
>
>
> --
> ----------------------------------------
> Ninth Avenue Software
> p: +61 7 3137 1351 (UTC +10)
> f: +61 7 3102 9141
> w: http://www.ninthavenue.com.au
> e: info@ninthavenue.com.au
> ----------------------------------------
>
>

Re: JSF is the answer? I don't think so...

Posted by Roger Keays <ro...@ninthavenue.com.au>.
Andrew Robinson wrote:
> Almost all of your issues relate to web pages that are information based 
> instead of form based. If you are not submitting data, you should 
> consider using all outputLinks instead of commandLinks. That way your 
> pages will be bookmark-able and have the ability to open in a new 
> window. If you must use commands on non-data data positing events, then 
> use redirect set to true to make sure the URL of the browser is updated.

I think people coming to JSF get so swamped with lifecycles, validators, 
converters etc that they forget you can always just put in an ordinary 
<a href="">, or even a plain old <form method="GET"> if you want.

Heck, just make all your pages static HTML and get the default servlet 
to serve them.

> 
> As for the browser back button, it has always worked for me in JSF with 
> server side state saving and should work fine with client side state 
> even better, what MyFaces version are you using?
> 
> Double form submission: this is not a framework issue, it is a user one 
> and an HTML one. There are many ways to "fix" this, like disabling the 
> button on click, disabling the form after submit, a phase listener that 
> "counts" submissions and skips the validation & update phases if a 
> repeat post, etc.
> 
> having multiple copies of a page/service in different browser tabs/windows:
> This is not an issue, why is it for you? Just avoid session scope. Use 
> request scope plus <t:saveState> or use the JBoss-Seam conversation 
> state (which is per window).
> 
> -Andrew
> 
> On 12/10/06, *Adam Koprowski* <adam.koprowski@gmail.com 
> <ma...@gmail.com>> wrote:
> 
>         Hello,
>       Approximately one year ago, together with my colleague, we had to
>     make a decision what technology to use for the development in some
>     project of ours. At the time, after quick investigation, we came up
>     with the idea of using J2EE, that is EJB + JSF. Let alone the EJB
>     but let me share with you some thoughts that I have about JSF after
>     this year of work with it.
>       Below you will find a mixture of features (that I would expect any
>     decent web framework to support) and problems (that I would expect
>     any decent framework to solve and let developer not worry about it).
>     Here we go:
>      -) use of browser back button,
>      -) page bookmarking,
>      -) double form submission (by double user click),
>      -) opening link in new browser tab/window,
>      -) having multiple copies of a page/service in different browser
>     tabs/windows
>       Now, correct me if I'm wrong, but I think all of the above pose
>     some (lots of?) difficulties in JSF. And I know that some of those
>     are not easy issues (like browser's back button) but personally I
>     think this list is way too long...
>       I don't really know any alternative web frameworks so I cannot
>     compare but is it really that the developer has to deal with all of
>     those issues on his own? Or are there frameworks where one does not
>     need to worry about those irritating problems and can concentrate on
>     real development... and JSF is just too immature to provide that? I
>     know this is not a myfaces specific question but I decided to post
>     this provocative question on this list as I'm curious about your
>     opinion guys...
>       Best wishes,
>        Adam Koprowski
> 
>     -- 
>     =====================================================
>     Adam.Koprowski@gmail.com <ma...@gmail.com>, ICQ: 3204612
>     http://www.win.tue.nl/~akoprows <http://www.win.tue.nl/%7Eakoprows>
>     The difference between impossible and possible
>     lies in determination (Tommy Lasorda)
>     ===================================================== 
> 
> 


-- 
----------------------------------------
Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: info@ninthavenue.com.au
----------------------------------------


Re: JSF is the answer? I don't think so...

Posted by Andrew Robinson <an...@gmail.com>.
Almost all of your issues relate to web pages that are information based
instead of form based. If you are not submitting data, you should consider
using all outputLinks instead of commandLinks. That way your pages will be
bookmark-able and have the ability to open in a new window. If you must use
commands on non-data data positing events, then use redirect set to true to
make sure the URL of the browser is updated.

As for the browser back button, it has always worked for me in JSF with
server side state saving and should work fine with client side state even
better, what MyFaces version are you using?

Double form submission: this is not a framework issue, it is a user one and
an HTML one. There are many ways to "fix" this, like disabling the button on
click, disabling the form after submit, a phase listener that "counts"
submissions and skips the validation & update phases if a repeat post, etc.

having multiple copies of a page/service in different browser tabs/windows:
This is not an issue, why is it for you? Just avoid session scope. Use
request scope plus <t:saveState> or use the JBoss-Seam conversation state
(which is per window).

-Andrew

On 12/10/06, Adam Koprowski <ad...@gmail.com> wrote:
>
>     Hello,
>   Approximately one year ago, together with my colleague, we had to make a
> decision what technology to use for the development in some project of ours.
> At the time, after quick investigation, we came up with the idea of using
> J2EE, that is EJB + JSF. Let alone the EJB but let me share with you some
> thoughts that I have about JSF after this year of work with it.
>   Below you will find a mixture of features (that I would expect any
> decent web framework to support) and problems (that I would expect any
> decent framework to solve and let developer not worry about it). Here we go:
>
>  -) use of browser back button,
>  -) page bookmarking,
>  -) double form submission (by double user click),
>  -) opening link in new browser tab/window,
>  -) having multiple copies of a page/service in different browser
> tabs/windows
>   Now, correct me if I'm wrong, but I think all of the above pose some
> (lots of?) difficulties in JSF. And I know that some of those are not easy
> issues (like browser's back button) but personally I think this list is way
> too long...
>   I don't really know any alternative web frameworks so I cannot compare
> but is it really that the developer has to deal with all of those issues on
> his own? Or are there frameworks where one does not need to worry about
> those irritating problems and can concentrate on real development... and JSF
> is just too immature to provide that? I know this is not a myfaces specific
> question but I decided to post this provocative question on this list as I'm
> curious about your opinion guys...
>   Best wishes,
>    Adam Koprowski
>
> --
> =====================================================
> Adam.Koprowski@gmail.com , ICQ: 3204612
> http://www.win.tue.nl/~akoprows <http://www.win.tue.nl/%7Eakoprows>
> The difference between impossible and possible
> lies in determination (Tommy Lasorda)
> =====================================================

Re: [OT] RE: JSF is the answer? I don't think so...

Posted by Andrew Robinson <an...@gmail.com>.
> Is it possible to use Seam with EJB 2.0 or only with EJB3?

I'm pretty sure it doesn't. But it does work with POJOs. So you could
have POJO backing beans that talk to your EJB2.0 beans. This way you
can avoid EJB3 for now. I am using seam on two projects one POJO and
one EJB3 and it is working fine on both.

> I saw in [1] that usage of Tomahawk components is not recommended

Not that I knew of. We are using it and it works just fine. My one
large complaint with Tomahawk and MyFaces is that there are no bug fix
versions, only new functionality versions, so if you want a stable
build you have to apply patches from SVN yourself to the source code
to make your own stable build

-Andrew

Re: [OT] RE: JSF is the answer? I don't think so...

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hey.
> -) I saw in [1] that usage of Tomahawk components is not recommended - does
> it pose some (serious) problems? Is it possible at all to use them? How
> about dojo?
>
> [1] http://docs.jboss.com/seam/1.1BETA2/reference/en/html/controls.html
>   
> We recommend the Ajax4JSF and ADF faces (now Trinidad) tag libraries
for use with Seam. We do not recommend the use of the Tomahawk tag library.

Its a shame to put such a statement in the documentation without an
explanations (or a link to a page) whats bad with tomahawk. I have no
clue whats wrong with tomahawk, we use it in our productive environment
since a long time.


Regarding JBoss Seam:
If you do not require stuff like BPEL I'll also point you to our
Conversation Tag [1] in tomahawks sandbox.
This is a lightweight library which just helps you putting JSF+EJB3
together by introducing a conversation context which can be synchronized
with the database (which was the basic idea of Seam too, IMO)
You can use it with JSP or Facelets.

Ciao,
Mario


[1] http://wiki.apache.org/myfaces/ConversationTag


Re: [OT] RE: JSF is the answer? I don't think so...

Posted by Adam Koprowski <Ad...@gmail.com>.
   Hello everybody,

 Thanks for all your answers, hints, encouragement... I really appreciate
that. I'm not about to give up, I'm just trying to figure out what's the
best thing to do. Using plain old links may work in some cases but often you
really have some kind of a state in your web application to deal with and
this seems pretty difficult with JSF (although ADF processScope makes it
somehow easier). And in fact our (implicit) goal was to limit the technology
stack not to depend from too many frameworks. And we thought (naively?) that
EJB + JSF should be enough as EJB takes care of business logic and database
mapping and JSF is supposed to deal with the web presentation layer. 
  Anyhow, Seam seems pretty interesting for us, especially that we are
already using JBoss AS. Couple of questions though:

-) Is it possible to use Seam with EJB 2.0 or only with EJB3? I don't think
we're ready to move to EJB3 at the moment (mainly out of concern that it
seems to be too young to be production ready)

-) Suppose we want to move to JSF+Seam+Facelets instead of JSF+JSP. How much
do those approaches differ? Would it require us to write all the
presentation stuff from scratch or could we somehow use what we have up till
now?

-) I saw in [1] that usage of Tomahawk components is not recommended - does
it pose some (serious) problems? Is it possible at all to use them? How
about dojo?

   Thanks a lot for your help,
   Adam Koprowski

[1] http://docs.jboss.com/seam/1.1BETA2/reference/en/html/controls.html


Daniel Young wrote:
> 
>  
> 
> Hi Adam,
> 
>  
> 
> I would recommend taking a look at JBoss Seam, which solves many (possibly
> all) of these issues.
> 
> Enjoy, and don't give up,
> 
> Daniel.
> 
> 

-- 
View this message in context: http://www.nabble.com/JSF-is-the-answer--I-don%27t-think-so...-tf2794657.html#a7864136
Sent from the MyFaces - Users mailing list archive at Nabble.com.


[OT] RE: JSF is the answer? I don't think so...

Posted by Daniel Young <dy...@synyati.com.au>.
 

Hi Adam,

 

I would recommend taking a look at JBoss Seam, which solves many (possibly
all) of these issues.

 

Enjoy, and don't give up,

Daniel.

 

  _____  

From: Simon Lessard [mailto:simon.lessard.3@gmail.com] 
Sent: Tuesday, 12 December 2006 2:11 AM
To: MyFaces Discussion
Subject: Re: JSF is the answer? I don't think so...

 

Hello Adam,

Most of those problems can be handled by other frameworks complementary to
JSF. JSF was not made specifically, nor only, for transaction based
application. All the problems you're mentioning are linked to stateful
applications. There're many solutions then, like container managed
transaction for example. You can give a look to what Hibernate, Spring, EJB
3 and such have to offer for some/all of the issues. JSF works great with
any of those technologies. 


Regards,

~ Simon

On 12/10/06, Adam Koprowski <ad...@gmail.com> wrote: 

    Hello,
  Approximately one year ago, together with my colleague, we had to make a
decision what technology to use for the development in some project of ours.
At the time, after quick investigation, we came up with the idea of using
J2EE, that is EJB + JSF. Let alone the EJB but let me share with you some
thoughts that I have about JSF after this year of work with it. 
  Below you will find a mixture of features (that I would expect any decent
web framework to support) and problems (that I would expect any decent
framework to solve and let developer not worry about it). Here we go: 
 -) use of browser back button,
 -) page bookmarking,
 -) double form submission (by double user click),
 -) opening link in new browser tab/window,
 -) having multiple copies of a page/service in different browser
tabs/windows 
  Now, correct me if I'm wrong, but I think all of the above pose some (lots
of?) difficulties in JSF. And I know that some of those are not easy issues
(like browser's back button) but personally I think this list is way too
long... 
  I don't really know any alternative web frameworks so I cannot compare but
is it really that the developer has to deal with all of those issues on his
own? Or are there frameworks where one does not need to worry about those
irritating problems and can concentrate on real development... and JSF is
just too immature to provide that? I know this is not a myfaces specific
question but I decided to post this provocative question on this list as I'm
curious about your opinion guys... 
  Best wishes,
   Adam Koprowski

-- 
=====================================================
Adam.Koprowski@gmail.com , ICQ: 3204612
http://www.win.tue.nl/~akoprows <http://www.win.tue.nl/%7Eakoprows>  
The difference between impossible and possible
lies in determination (Tommy Lasorda)
===================================================== 

 


Re: JSF is the answer? I don't think so...

Posted by Simon Lessard <si...@gmail.com>.
Hello Adam,

Most of those problems can be handled by other frameworks complementary to
JSF. JSF was not made specifically, nor only, for transaction based
application. All the problems you're mentioning are linked to stateful
applications. There're many solutions then, like container managed
transaction for example. You can give a look to what Hibernate, Spring, EJB
3 and such have to offer for some/all of the issues. JSF works great with
any of those technologies.


Regards,

~ Simon

On 12/10/06, Adam Koprowski <ad...@gmail.com> wrote:
>
>     Hello,
>   Approximately one year ago, together with my colleague, we had to make a
> decision what technology to use for the development in some project of ours.
> At the time, after quick investigation, we came up with the idea of using
> J2EE, that is EJB + JSF. Let alone the EJB but let me share with you some
> thoughts that I have about JSF after this year of work with it.
>   Below you will find a mixture of features (that I would expect any
> decent web framework to support) and problems (that I would expect any
> decent framework to solve and let developer not worry about it). Here we go:
>
>  -) use of browser back button,
>  -) page bookmarking,
>  -) double form submission (by double user click),
>  -) opening link in new browser tab/window,
>  -) having multiple copies of a page/service in different browser
> tabs/windows
>   Now, correct me if I'm wrong, but I think all of the above pose some
> (lots of?) difficulties in JSF. And I know that some of those are not easy
> issues (like browser's back button) but personally I think this list is way
> too long...
>   I don't really know any alternative web frameworks so I cannot compare
> but is it really that the developer has to deal with all of those issues on
> his own? Or are there frameworks where one does not need to worry about
> those irritating problems and can concentrate on real development... and JSF
> is just too immature to provide that? I know this is not a myfaces specific
> question but I decided to post this provocative question on this list as I'm
> curious about your opinion guys...
>   Best wishes,
>    Adam Koprowski
>
> --
> =====================================================
> Adam.Koprowski@gmail.com , ICQ: 3204612
> http://www.win.tue.nl/~akoprows <http://www.win.tue.nl/%7Eakoprows>
> The difference between impossible and possible
> lies in determination (Tommy Lasorda)
> =====================================================