Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #4644

Re: Dealing with application names in a JEE web app

From Arved Sandstrom <asandstrom3minus1@eastlink.ca>
Newsgroups comp.lang.java.programmer
Subject Re: Dealing with application names in a JEE web app
References (2 earlier) <irjkiq$ocr$1@dont-email.me> <alpine.DEB.2.00.1105261801170.19918@urchin.earth.li> <irm2dd$g93$1@news.albasani.net> <irmbca$9c9$1@dont-email.me> <irmo9j$vi2$1@news.albasani.net>
Message-ID <Y3LDp.5744$VK6.134@newsfe22.iad> (permalink)
Organization Public Usenet Newsgroup Access
Date 2011-05-27 07:31 -0300

Show all headers | View raw


On 11-05-26 08:39 PM, Lew wrote:
> markspace wrote:
>> Lew wrote:
>>> I've been able to work out "all this" pretty much from
>>> http://download.oracle.com/javaee/6/tutorial/doc/bnadp.html
>>> the MyFaces docs and the articles in IBM DeveloperWorks.
> 
>> Thanks for pointing out those additional resources. I think right now I'm
> 
> I forgot to mention the most important one: lots of example apps that I
> created in my (copious) spare time.  I went nuts in JSF 1.something when
> "rendered='false'" on first page call would prevent a component from
> being in the tree, never to be reinserted in postback when the value
> flipped to 'true'.  They fixed that later.  I went nuts overall until I
> began to grok the six-stage component lifecycle of JSF.

I similarly went nuts in my early exposure to JSF until I learnt that
lifecycle. I lived by Rick Hightower and BalusC. These days I go nuts
because I work with people who have had to use JSF for the same length
of time as me, but who haven't bothered to learn the lifecycle, and
screw coding up because of it.

Typical problem - people not realizing how often getters get called in
first view or postback, and jamming all sorts of unguarded persistence
operations into getters as a result. "Duhhhhh...why did that table get
updated twice?"

> I went nuts
> until I learned that every backing bean is a controller, unlike the
> front-controller pattern familiar to Model 2 and Struts mavens.

One other thing to learn early on is the distinction between JSF managed
beans and JSF backing beans. Many of the same aforementioned people use
the terms indistinguishably, and I wish they wouldn't. No excuse for
this confusion: the Java EE tutorial explains the difference clearly in
2 sentences.

I like the (newish) CDI annotations that allow the "managing" bit -
naming and scoping, for starters - not to be a JSF thing. I use them
when I can.

For my own amusement I dissected the JSF controller behaviour some years
ago. With reference to Fowler's P of EAA stuff, there are aspects of
both front and page controllers in JSF. To be pedantic, I'd argue that
it's still more Front controller than Page controller: the FacesServlet
actually handles the requests. The getters/setters in a JSF backing bean
that are associated with UI components only process a request meant for
them in a rather anemic, last-mile way. And the actions in a backing
bean are akin to the command objects inherent in Front Controller.
FacesServlet handles the navigation also.

If someone makes a Page Controller argument for JSF, and that's been
done more than once, I won't get bent out of shape because of it. One
one level of abstraction the JSF beans look like page controllers. As
long as one understands the mechanics that's fine. But I personally
really think it's still Front Controller.

> I still
> don't use "immediate='true'".

I almost never use it either now. The reason I don't is because it takes
some quality reading to understand what "immediate" does (see the
excellent description at
http://wiki.apache.org/myfaces/How_The_Immediate_Attribute_Works), and
you have to re-read and refresh yourself on that every few months when
your use of "immediate" has caused a bug (or more likely, some other
developer never read up on it and uses "immediate" incorrectly, and
you've got to fix the defect).

It's just not worth it.

> I must've tried every variation of URL in JSF, JSTL, jsp:useBean and
> such structures as I've learned my J{2,ava }EE skills in order to learn
> where things need to be for the app server to find them.  I still am not
> fully aware of the nuances.

Other takeaways: thank God for Facelets. I haven't used JSPs in 3 years.
And even though it's got better support in JSF 1.2 and 2.0 than it did
in 1.1, _don't_ mix JSTL and JSF. If you're writing JSF JSPs or
Facelets, and you think you need JSTL, think again - you don't.

>> mostly concerned that the JSF 2.1 spec seems a lot less complete than
>> the JSP
>> and Servlet one, and that the book I purchased by the spec co-lead seems
>> equally abbreviated. You'd think Sun (and now Oracle) would be most
>> interested
>> in making sure that accurate and complete documentation is available.
>> "Google
>> for it and read some blogs" seems like the opposite of that idea.
>>
>> Don't mind me though, I'm typically grumpy when I'm trying to plow my way
>> through new concepts.
> 
> Curmudgeons of the world, uni- - - ah, screw it!
> 
> If programming was easy, anyone could do it.  Sometimes you just have to
> bang your (metaphorical) head against the (metaphorical) brick walls
> until something (hopefully the wall) crumbles (metaphorically).  And I
> truly found that GIMF through all that with JSF.
> 
I am reasonably fond of both JSF (especially JSF 2.0) and ASP.NET MVC.
As far as I am concerned both teams got It.

AHS

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Dealing with application names in a JEE web app markspace <-@.> - 2011-05-23 12:11 -0700
  Re: Dealing with application names in a JEE web app Lew <noone@lewscanon.com> - 2011-05-23 15:30 -0400
    Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-23 12:41 -0700
    Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-23 13:10 -0700
      Re: Dealing with application names in a JEE web app Lew <noone@lewscanon.com> - 2011-05-23 17:02 -0400
        Re: Dealing with application names in a JEE web app jebblue <n@n.nnn> - 2011-05-23 19:30 -0500
          Re: Dealing with application names in a JEE web app Lew <noone@lewscanon.com> - 2011-05-23 21:13 -0400
        Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-24 09:32 -0700
  Re: Dealing with application names in a JEE web app Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-05-23 19:01 -0300
  Re: Dealing with application names in a JEE web app Owen Jacobson <angrybaldguy@gmail.com> - 2011-05-23 23:20 -0400
  Re: Dealing with application names in a JEE web app Tom Anderson <twic@urchin.earth.li> - 2011-05-24 18:16 +0100
    Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-25 12:16 -0700
      Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-25 16:40 -0700
      Re: Dealing with application names in a JEE web app Tom Anderson <twic@urchin.earth.li> - 2011-05-26 18:07 +0100
        Re: Dealing with application names in a JEE web app Lew <noone@lewscanon.com> - 2011-05-26 13:25 -0400
          Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-26 12:57 -0700
            Re: Dealing with application names in a JEE web app Lew <noone@lewscanon.com> - 2011-05-26 19:39 -0400
              Re: Dealing with application names in a JEE web app Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-05-27 07:31 -0300
                Re: Dealing with application names in a JEE web app Lew <noone@lewscanon.com> - 2011-05-27 10:14 -0400
        Re: Dealing with application names in a JEE web app markspace <-@.> - 2011-05-26 12:51 -0700
        Re: Dealing with application names in a JEE web app Steve Sobol <sjsobol@JustThe.net> - 2011-05-26 14:51 -0700

csiph-web