Although I just created some very basic demos it didn't take long to get into building tables from collections and other more useful demos. Few things really impressed me about JSF 2.0.
1. Finally I can add references to my model attributes as follows without the need to use a h:outputText component
#{TaskBean.info}
2. You can simply use a default bean name for backing beans without the need to declare beans with managed-bean in faces-config.xml. You simple put @ManagedBean above the class definition.
@ManagedBean(eager=true)
@SessionScoped
public class CalculatorManagedBean implements Serializable {
public static char[] operands = { '+', '-', '*', '/' };
3. The use of Facelets, not JSP, as the standard technology for all your JSF pages. So you name your page pas.xhtml and can reference it as pas.jsf as long as your web.xml contains the following.
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
4. No real need to define explicit navigation rules. If your bean methods return a a string as follows then the resulting page pas.xhtml will be called.
return "pas";
Hope to spend more time on JSF 2.0 and of course there is more to it then just this but thats a good enough start for me.
3 comments:
Hey - I am certainly happy to find this. Good job!
Hi - I am definitely happy to find this. cool job!
Post a Comment