You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Garner, Shawn" <sh...@pearson.com> on 2006/01/11 20:18:58 UTC

RE: [OT] Getting started is confusing [was] Re: Need advice bet ween Shale or Struts-Faces

First thing I did was to create a helper base class with methods like the
following

public Object getRequestParameter(String key)
{
	return
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMa
p().get(key);
}

Doesn't seem very hard to me.
Shawn
-----Original Message-----
From: Frank W. Zammetti [mailto:fzlists@omnytex.com] 
Sent: Wednesday, January 11, 2006 9:51 AM
To: Struts Users Mailing List
Cc: Struts Users Mailing List
Subject: Re: [OT] Getting started is confusing [was] Re: Need advice between
Shale or Struts-Faces

On Wed, January 11, 2006 10:06 am, Rick Reumann said:
> Anyway, I'm totally babbling now, but am I the only one that feels this
> confusion? It's more confusing when you try to think of how you can use
> these different technologies together (ie Shale and MyFaces).

You are most definitely NOT alone.  I can't tell you how many people I
hear from (because I've posted my less than positive feelings on JSF
numerous times I suppose) saying essentially the same thing.  JSF may
indeed be the greatest thing since sliced bread, but many people seem to
have a hard time getting the information they need to reach that
conclusion.

My major complaint is that every single example and tutorial I've found is
so simplistic and frankly ugly as hell that it can't help but cast JSF in
a bad light.  It makes it seem like all you can do is webapps that look
like something straight out of 1996... and I know that isn't an accurate
representation of what JSF can do, but it's the conclusion one reaches in
seeing all these examples.  Just once I'd like to see a good, interesting,
MODERN-LOOKING and well-documented example that shows off all the supposed
benefits of JSF.  If I were a JSF supporter out there, I'd get this done
and get it in front of people ASAP.

My secondary complaint is that nearly every article I read starts off with
"JSF simplifies things and makes your life easier", and then proceeds to
completely negate that statement with all sorts of config files and code
like this:

String var =
(String)FacesContext.getCurrentInstance().getExternalContext().getRequestPar
ameterMap().get("variableName");

Just an example, and maybe not the best one, but I see A LOT of JSF
example code that has a bunch of stringed-together method calls like this.
 I don't know what anyone else' opinion is, but I don't look at a line of
code like that and think "yeah, this is so much easier!".  I'm not saying
there isn't some benefit, and I would assume there are ways around it (I'd
bet Shale provides many of them) but it's hard to see what the point is
when confronted with lines like that.

So no, you aren't alone.  I've changed my own tune over time... I used to
be pretty strongly anti-JSF, I'm not any more.  Now, I keep looking at it
fresh every few months, trying to do some small project with it and trying
to convince myself it's good.  I haven't gotten there yet, but I'm not
giving up either.  My hope in the end is that it is a viable ALTERNATIVE,
which I think would be great.  If it becomes THE way webapps are developed
though, I for one, as JSF exists today, will hate my life :)

Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

**************************************************************************** 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 
****************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Getting started is confusing [was] Re: Need advice bet ween Shale or Struts-Faces

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Craig McClanahan wrote:
> Someone earlier on this thead mentioned that they would deal with this using
> managed beans and the dependency injection mechanism it supports to inject
> request parameters (not associated with a component) into the backing bean.
> Great idea!  By far the simplest thing to do.  But, picture the lament that
> started this thread ("JSF is more complex and/or not documented well
> enough") and think about what it would mean if the Hello, World program for
> JSF required you to understand IoC :-).

But OTOH, such an example might not leave people with the "what's the 
benefit of all this?" questions afterwards.

I agree what was described is a good approach (and pretty closely echoes 
what I described I've been doing with Struts and my DependencyFilter 
from JWP recently), but another complaint I've personally heard a lot 
(and had myself frankly) is that when you get through many of the 
tutorials, your left thinking that what JSF offers isn't significantly 
*better* than what we have today, just *different*.  Many people want to 
know why it's better, not why it's different.

The managed bean support is, IMO, one of the nicer things about JSF, and 
I'd like to see it get more publicity.

> Shawn
> 
> 
> Craig

Frank

(one more, we have a barber shop quartet! LOL )

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Getting started is confusing [was] Re: Need advice bet ween Shale or Struts-Faces

Posted by Craig McClanahan <cr...@apache.org>.
On 1/11/06, Garner, Shawn <sh...@pearson.com> wrote:
>
> First thing I did was to create a helper base class with methods like the
> following
>
> public Object getRequestParameter(String key)
> {
>         return
> FacesContext.getCurrentInstance
> ().getExternalContext().getRequestParameterMa
> p().get(key);
> }
>
> Doesn't seem very hard to me.


It is indeed pretty easy ... and you'll see that Shale builds a whole bunch
of useful utility methods into its optional base classes for backing beans.

On the particular case of request parameters, however, my view is that most
web developers get themselves in trouble by worrying about such a low level
detail.  You should be programming in terms of the *values* that were
submitted, not the *method* by which they were submitted.  Whatever
framework you are using should take care of the mapping between parameters
and values for you.  Unfortunately, peoples's existing experiences with
frameworks sets the bar too low.

This issue doesn't have much to do with what framework you are using, or
even what language (pretty much every Java or PHP or PERL "framework" is
implemented in these same low-level ways).  But, if you want to improve your
own productivity, look for solutions that get you out of having to deal with
all this stuff.

Someone earlier on this thead mentioned that they would deal with this using
managed beans and the dependency injection mechanism it supports to inject
request parameters (not associated with a component) into the backing bean.
Great idea!  By far the simplest thing to do.  But, picture the lament that
started this thread ("JSF is more complex and/or not documented well
enough") and think about what it would mean if the Hello, World program for
JSF required you to understand IoC :-).

Shawn


Craig

RE: [OT] Getting started is confusing [was] Re: Need advice bet ween Shale or Struts-Faces

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
On Wed, January 11, 2006 2:18 pm, Garner, Shawn said:
> First thing I did was to create a helper base class with methods like the
> following
>
> public Object getRequestParameter(String key)
> {
> 	return
> FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMa
> p().get(key);
> }
>
> Doesn't seem very hard to me.

No, not very hard at all.  But what's the point of a framework where I
*have* to do that?

And again, I realize I probably didn't choose the best example because
maybe it isn't something your *supposed* to do in the JSF mindset, and I
also realize that Shale seeks to address issues just like this (as does
the new JSF spec, from what Craig has said).  But for *today*, they exist.

> Shawn

Frank

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Getting started is confusing [was] Re: Need advice bet ween Shale or Struts-Faces

Posted by Alexandre Poitras <al...@gmail.com>.
Anyway *usually* you don't need to use this method unless you are
developping a new component. It is supposed to be the responsability of the
components to retrieve the request parameters, so the application developper
doesn't have to deal with the Http protocol details.

On 1/11/06, Garner, Shawn <sh...@pearson.com> wrote:
>
> First thing I did was to create a helper base class with methods like the
> following
>
> public Object getRequestParameter(String key)
> {
>         return
> FacesContext.getCurrentInstance
> ().getExternalContext().getRequestParameterMa
> p().get(key);
> }
>
> Doesn't seem very hard to me.
> Shawn
> -----Original Message-----
> From: Frank W. Zammetti [mailto:fzlists@omnytex.com]
> Sent: Wednesday, January 11, 2006 9:51 AM
> To: Struts Users Mailing List
> Cc: Struts Users Mailing List
> Subject: Re: [OT] Getting started is confusing [was] Re: Need advice
> between
> Shale or Struts-Faces
>
> On Wed, January 11, 2006 10:06 am, Rick Reumann said:
> > Anyway, I'm totally babbling now, but am I the only one that feels this
> > confusion? It's more confusing when you try to think of how you can use
> > these different technologies together (ie Shale and MyFaces).
>
> You are most definitely NOT alone.  I can't tell you how many people I
> hear from (because I've posted my less than positive feelings on JSF
> numerous times I suppose) saying essentially the same thing.  JSF may
> indeed be the greatest thing since sliced bread, but many people seem to
> have a hard time getting the information they need to reach that
> conclusion.
>
> My major complaint is that every single example and tutorial I've found is
> so simplistic and frankly ugly as hell that it can't help but cast JSF in
> a bad light.  It makes it seem like all you can do is webapps that look
> like something straight out of 1996... and I know that isn't an accurate
> representation of what JSF can do, but it's the conclusion one reaches in
> seeing all these examples.  Just once I'd like to see a good, interesting,
> MODERN-LOOKING and well-documented example that shows off all the supposed
> benefits of JSF.  If I were a JSF supporter out there, I'd get this done
> and get it in front of people ASAP.
>
> My secondary complaint is that nearly every article I read starts off with
> "JSF simplifies things and makes your life easier", and then proceeds to
> completely negate that statement with all sorts of config files and code
> like this:
>
> String var =
>
> (String)FacesContext.getCurrentInstance().getExternalContext().getRequestPar
> ameterMap().get("variableName");
>
> Just an example, and maybe not the best one, but I see A LOT of JSF
> example code that has a bunch of stringed-together method calls like this.
> I don't know what anyone else' opinion is, but I don't look at a line of
> code like that and think "yeah, this is so much easier!".  I'm not saying
> there isn't some benefit, and I would assume there are ways around it (I'd
> bet Shale provides many of them) but it's hard to see what the point is
> when confronted with lines like that.
>
> So no, you aren't alone.  I've changed my own tune over time... I used to
> be pretty strongly anti-JSF, I'm not any more.  Now, I keep looking at it
> fresh every few months, trying to do some small project with it and trying
> to convince myself it's good.  I haven't gotten there yet, but I'm not
> giving up either.  My hope in the end is that it is a viable ALTERNATIVE,
> which I think would be great.  If it becomes THE way webapps are developed
> though, I for one, as JSF exists today, will hate my life :)
>
> Frank
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ****************************************************************************
> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
>
> ****************************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
Alexandre Poitras
Québec, Canada