1 / 60

Java Server Faces adopting the standard

Java Server Faces adopting the standard. Roi Aldaag Consultant, AlphaCSP. Agenda. Introduction Architecture Configuration Features Pros & Cons. Introduction. Not so long ago, if you “Googled“ the word JSF , you probably would have come across …. Introduction.

korene
Download Presentation

Java Server Faces adopting the standard

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Java Server Facesadopting the standard Roi Aldaag Consultant, AlphaCSP

  2. Agenda • Introduction • Architecture • Configuration • Features • Pros & Cons

  3. Introduction • Not so long ago, if you “Googled“ • the word JSF, you probably would • have come across …

  4. Introduction The F-35 Joint Strike Fighter (JSF) …

  5. Introduction JavaServer Faces Technology Today you’d find…

  6. Introduction :: What is JSF? • What is JSF ? • Specification • UI framework • Component based • Server side • Java web applications

  7. Introduction :: Motivation 9 Billion Reasons for JSF…

  8. Introduction :: Motivation • JCP Standard JSF 1.0/1.1JSR 127 May 2005 JSF 1.2JSR 252 May 2006 JSF 2.0 JSR 314 Q4 2008 ? / JEE6

  9. Introduction :: Motivation • Vendor adoption • JSF RI • MyFaces

  10. Introduction :: Motivation • Popularity • Commercial Projects • Open Source Projects • Market • Documentation

  11. Introduction :: Motivation • IDE integration • Visual tool support • Drag & Drop • Auto-complete

  12. Introduction :: Motivation • Tools • Component Libraries • IceFaces • RichFaces • ADF / Trinidad • Tomahawk • Extensions • Facelets • Ajax4Jsf • DinoFaces

  13. Introduction :: Motivation • View Technology • JSP / Servlet • Other template engines • Facelets • JSFTemplating • Multiple rendering output from same pages

  14. Introduction :: What is Seam? • What is Seam ? • A lightweight framework for JEE5 • Unifies JSF and EJB models(Web Beans / JSR 299) • Integrates JSF, POJOs, JPA, jBMP, Drools • Annotation / EL based • Extends JSF • JBoss OS (LGPL) • Release at 2006 • Current version 2.0.2 SP1

  15. Introduction :: What is Seam? • Misconceptions • Can be used without EJB3 • Does not need a container • Has a small footprint • Easy integration

  16. Introduction :: Why JSF+Seam? • Why JSF + Seam? • JSF has some weaknesses… • Seam extends and enhances JSF • Reduces boilerplate code • Annotations • RESTful URLs • JSF Lifecycle • Contextual state management • Ajax Remoting • Exception Handling • Simple Integration • EJB3 / jBMP/ Drools / Spring

  17. Introduction :: Seam in action

  18. Agenda • Introduction • Architecture • Configuration • Features • Pros & Cons

  19. Architecture :: JSF MVC • Model • View • Controller

  20. Architecture :: JSF MVC Model • POJO’s

  21. Architecture :: JSF MVC Controller • Front Servlet • Configuration • Event Listeners

  22. Architecture :: JSF MVC View • Component Tree • Component Model • Delegates • Resources

  23. Architecture :: Component Tree JSF tags Component Tree Markup ... <f:view> <h:form> <h:panelGrid columns = "2"> <h:inputText/> <h:inputSecret/> </panelGrid> </h:form> </f:view> .. HTML WML XML JSP

  24. Architecture :: JSF Lifecycle • JSF Lifecycle • Restore view • Apply request values • Process validations • Update model values • Invoke application • Render response

  25. Architecture :: Seam Lifecycle • Seam Lifecycle • Restore view • Restore Conversation • Apply Page Parameters • Apply request values • Process validations • Update model values • Invoke application • Process Selection • Store Conversation • Render response

  26. Architecture :: Seam Concepts • Seam Concepts • Three Tier • POJOs and annotations • IoC and bijection • Contextual state management • Interceptors

  27. Agenda • Introduction • Architecture • Configuration • Features • Pros & Cons

  28. Configuration :: JSF faces-config.xml

  29. Configuration :: Seam faces-config.xml

  30. Configuration :: JSF web.xml

  31. Configuration :: Seam web.xml

  32. Agenda • Introduction • Architecture • Configuration • Features • Pros & Cons

  33. Features :: Demo JSF Project jsfLogin.jsp jsfMasterDetail.jsp LoginBean.java MasterDetailBean.java XML JSP XML JSP faces-config.xml web.xml

  34. Features :: Demo Seam Project jsfLogin.jsp jsfMasterDetail.jsp LoginBean.java MasterDetailBean.java XML XML JSP seam.properties components.xml JSP faces-config.xml web.xml jboss-seam.jar jboss-seam-ui.jar

  35. Features :: Demo Login page jsfLogin.jsp UIViewRoot UIForm UIPanel UIPanel UIPanel UIOutput UICommand UIInput UIOutput UIInput

  36. Features :: JSF Value Binding LoginBean.java faces-config.xml Managed Bean jsfLogin.jsp Unified EL

  37. Features :: JSF Method Binding LoginBean.java jsfLogin.jsp Invoke Application Phase

  38. Features :: JSF State Management jsfLogin.jsp jsfMasterDetail.jsp User Dependency Injection

  39. Features :: Seam State Management • Contextual state management • Bijection • @In - Injection • @Out – Outjection • Dynamic, contextual, bidirectional • Context Scope • Event < Page < Conversation < Business Process < Session < Application • Conversation • Temporary conversation • Long-running conversation • ConversationId

  40. Features :: Seam State Management MasterDetailBean.java

  41. Features :: JSF Page Flow LoginBean.java jsfLogin.jsp jsfMasterDetail.jsp faces-config.xml

  42. Features :: Seam Page Flow HTTP GET • Page Actions • HTTP GET • Bookmarking • RESTful URLs HTTP POST

  43. Features :: Seam Page Flow • Page Flow • JBoss Business Process Management (jBPM) • Used to define process workflow / page flow • Define transition between pages • Define navigation rules for each page • Flow is based on events and conditions • Back button • In conversation mode, back button is disallowed • Undefined transition • Seam blocks actions from “stale” pages • Redirects to relevant page

  44. Features :: JSF Validations MasterDetailBean.java jsfMasterDetail.jsp

  45. Features :: Seam Validations @org.hibernate.validator.Email MasterDetailBean.java jsfMasterDetail.jsp

  46. Features :: JSF Error Handling javax.servlet.ServletException: javax/servlet/jsp/tagext/JspIdConsumer

  47. Features :: Seam Error Handling

  48. Features :: Seam Error Handling • Exception Annotations

  49. Features :: Demo MasterDetail page jsfMasterDetail.jsp MasterDetailBean.java

More Related