>, it's worth noting that just a few
> weeks ago, already  
> knowing Struts & JSP, I spent four or five days
> experimenting with  
> JSF, found it cumbersome and unsatisfying, tried
> Tapestry instead,  

That is pretty much my experience with JSF too. I
recently built comparison application to try out 
Tapestry;
Struts+Tiles;
Struts+SiteMesh;
JSF(MyFaces);
With exactly the same backend (Hibernate under
Spring).

What can I say: JSF is horrible! Tapestry has a
learning curve, but JSF one was horrifying. I bought
Kito Mann’s book JSF in Action and it is mind blowing
how cumbersome simple things are:
JSF documentation is awkward and incomplete;
Lets take parameters for example, simple thing a
parametrized command link:
<h:commandLink 
actionListener="#{companyCRUDForm.show}"
                                         
action="crud"
                                         
immediate="true"
                                         
value="show">
                               <f:param  name="id"
value="#{c.id}"/>
                            </h:commandLink>

1st – we cannot call parameterized function- it is
non-argument navigation function, or action listener
that takes ActionEvent, but we cannot control
navigation from the listener, therefore we have
awkward combination of actionListener parameter that
invokes function where we do stuff, and action
parameter that allows navigation.

2nd – accessing parameters – mind blowing IMO:
from Kito’s book examples:

public void doIt(ActionEvent actionEvent) {
                String param = null;
            List children =
actionEvent.getComponent().getChildren();
            for (int i = 0; i < children.size(); i++) {
              if (children.get(i) instanceof UIParameter) {
                UIParameter currentParam = (UIParameter)
children.get(i);
                if (currentParam.getName().equals("param") &&
                    currentParam.getValue() != null) {
                  param = currentParam.getValue().toString();
                  break;
                }
              }
            }
            FacesContext context =
FacesContext.getCurrentInstance();
            String id =
actionEvent.getComponent().getClientId(context);
            System.out.println("In doIt(), component id:
"+id+", param: "+param);
        }

What the heck!?  Is this friendly and convenient API?

JSF Configuration file, just look at that:

<managed-bean>
     
<managed-bean-name>globalOptions</managed-bean-name>
     
<managed-bean-class>com.sourcelabs.demo.webapp.web.jsf.GlobalOptions</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
          <property-name>pageLayout</property-name>
          <value>classic</value>
      </managed-property>
  </managed-bean>

Hey guys, have you ever heard about object
orientation? It looks ridiculous, same way as object
like
Class Person{
  String personFirstName;
  String personLastName;
  String personAge;
} 

C’mon JSF guys, get back to school -school year is
about to begin!


PS: Hope I will have time this week and add
documentation to my comparison and publish it.


Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of 
CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a 
Strategy for Reforming Universities and Public Schools.  New York:  State 
University of New York Press, 1997: (4) (5) (p.206)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to