Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Server Faces Çağatay Çivici Apache MyFaces Team Member

Similar presentations


Presentation on theme: "Java Server Faces Çağatay Çivici Apache MyFaces Team Member"— Presentation transcript:

1 Java Server Faces Çağatay Çivici Apache MyFaces Team Member cagatay@apache.org

2 Çağatay Çivici  Apache MyFaces Project Committer  OpenLogic Expert Group Member  Sourceforge jsf-comp project developer  JSF Client Side Validators  Acegi Security Framework’s JSF Components  JFreeChart for JSF : JSF Chart Creator  FacesTrace: Visual Debugger of JSF

3 Agenda  What is JSF?  JSF Component Model and Binding mechanism  JSF Request Lifecycle  IOC and Managed Beans  Navigations  Internalization and Resource Bundles  Extending JSF  Integration with Other Frameworks (Spring Framework Example)  Ajax with JSF  Facelets  Apache MyFaces  IDE Support  Future of JSF  Questions

4 What is JSF?  a component oriented and event driven web framework to build up web applications.  a Standard  various implementations Sun Reference Implementation Apache MyFaces Oracle ADF IBM

5 Architecture

6 Similar Concepts  Asp.net  Tapestry  Wicket  Swing

7 JSF vs Struts  Struts is an action framework Controller of the MVC pattern  JSF is an event driven and component oriented framework. JSF contains all the members of the MVC.  Model : Managed Beans  View : Components  Controller : Faces Servlet

8 JSF Component Model  Covers a wide range components. Reusable Customizable State aware  Easy to plug in third party components.  Easy to create custom components of your own.  Renderers brings abstraction

9 Simple Example: HtmlInputText  Declared as;  Gives the output  Customization attributes like; Styleclass Javascript events (onmousover etc...)

10 Binding makes JSF powerful  Value binding; binds a bean’s variable to a component.  Action binding, binds a method to an action component.

11 JSF Component Tree  Components are represented using a tree. 

12 Event Handling  Events are created based on the request parameters.  Each event is broadcasted to the related listeners.

13 State Management  JSF saves and restores the state of the components in each faces request. Client  As a hidden variable Server  As a session entry

14 JSF Request LifeCycle

15 Conversion and Validation  Submitted form values are strings  Conversion takes place to convert these values to java objects  Validation mechanism validates these converted objects Built-in converters and validators Easy to write custom converters and validators

16 Case Study

17 IOC and Managed Beans  JSF uses it’s own container to manage the beans in it’s context.  pc_Index demo.Index request someVariable #{pc_DB} pc_DB demo.Db session

18 Navigations  /login.jsp success /mainmenu.jsp failure /login.jsp  Action specific #{loginBean.loginAction}  Supports patterns *

19 Extending JSF  Navigation Handler  View Handler  Custom Resolvers  Phaselisteners  Custom Components

20 Multilanguage  Support for resource bundles tr en en_US de jsfsunum.messages  jsfsunum/messages.tr msg_welcome = Merhaba  Bundles on faces pages

21 Integration with Spring  JSF-Spring Using a delegating variable resolver  org.springframework.web.jsf.DelegatingVariableResolver ; backingBeanName yourpackagename.backingBeanClass request facadeService packagename.FacadeService #{facadeService}

22 Ajax with JSF  Components with ajax support  JSF ajax frameworks JSF Avatar Ajax Anywhere Ajax4jsf IceFaces Ajax enabled myFaces components

23 Facelets  Replacing jsp markup with xhtml  Templating  Composite components  Powerful view handler than jsf 1.1  No need for tag handlers of jsp

24 JSF IDE Support  Exadel Studio  IBM RSA  Oracle JDeveloper  Sun Studio Creator  MyEclipse  Bea Workshop  Macromedia jsftoolbox  Netbeans

25 Introducing Apache MyFaces  Open source implementation of JSF  Contains extended tomahawk library  Oracle ADF donation

26 MyFaces Component Demo  Basic form components  Datatable  File upload  Date and Calendar  Jscookmenu  Schedule  Accordion panel  Tabbed Panel  Ajax components  Tree  Dojo Toolkit  Fisheye  Html Editor  Chart Creator (jsf-comp component)

27 Future  JSF 1.2 and later JSF 2.0  More powerful IDE support  More components  Integrated Ajax Support

28 The End - Questions?  cagatay.civici@gmail.com  www.jroller.com/page/cagataycivici


Download ppt "Java Server Faces Çağatay Çivici Apache MyFaces Team Member"

Similar presentations


Ads by Google