JSF 2.0
                               Robert Reiz
Wednesday, January 27, 2010
Trainer


                 Robert Reiz Dipl. Inf. (FH-Mannheim)

                 Buch Mail-Travel-Agents auf Linux-System...
Trainer


                 Comitter

                      ploinFaces

                      ploinMailFactory

           ...
Eine Presentation ist keine Dokumentation!
      Eine Presentation soll lediglich den Speaker bei seinem
                 ...
Wer kennt JSF?




Wednesday, January 27, 2010
Was ist JSF?




Wednesday, January 27, 2010
Standards




                              JSF 1.0 - JSR 127 - May 2004
                              JSF 1.2 - JSR 252 -...
Lifecycle



            Request
                                         Apply Request     Process
                      ...
JSF 1.2
                              xmlns:h="http://java.sun.com/jsf/html"
                              xmlns:f="http:/...
<h:selectOneListbox id="edit_workUnit_selectedProject"
                                       value="${managedBean[project...
Wednesday, January 27, 2010
Implementierungen


                    JSF-RI
                  (mojarra)
                              MyFaces-Core


We...
Flora und Fauna



         RichFaces                                   IceFaces
                    ADF               Net...
Matrix




              http://www.jsfmatrix.net/



Wednesday, January 27, 2010
JSF 2.0




Wednesday, January 27, 2010
JSF 2.0 - Big changes


                              XML-Freie Konfig. mit Annotationen
                              Face...
JSF 2.0 - Small changes


                              Neue Scopes
                              System-events
          ...
Status Quo JSF 2.0

                  JSF-RI             ploinFaces

                (mojarra)
                           ...
Annotations



Wednesday, January 27, 2010
@ManagedBean
                      @RequestScoped
                      public class LogInBean {

                      	 ...
Facelets



Wednesday, January 27, 2010
Facelets



                          Nicht 1:1 übernommen
                          Templating
                          ...
Facelets - Template

                               layout.xhtml




             login.xhtml      welcome.xhtml   myData....
Facelets - Template
                <html xmlns="http://www.w3.org/1999/xhtml"
                	   xmlns:h="http://java.su...
Facelets - Template



                 <ui:composition template="/page/layout.xhtml">
                 	 <ui:param name="...
Facelets - Compon.


                              <html xmlns="http://www.w3.org/1999/xhtml"
                            ...
Facelets - Compon.



                   <html xmlns:gfu="http://java.sun.com/jsf/composite/gfu">




                  <g...
Clean Code




Wednesday, January 27, 2010
AJAX



Wednesday, January 27, 2010
AJAX



           <f:ajax event="keyup"
                   execute="@form"
                   render="form:result" />



...
AJAX




          <h:form id="form">
          	 <h:inputText value="#{welcomeBean.text}" >
          	 	 <f:ajax event="...
AJAX


                              jsf.ajax.addOnError(callback)

                              jsf.ajax.addOnEvent(call...
Resources



Wednesday, January 27, 2010
Resources



             <h:outputStylesheet name="css/style.css" />
             	
             <h:outputScript name="js...
[localePrefix/][libraryName/][libraryVersion/]resourceName[/resourceVersion]




               /META-INF/resources/compLib...
Bookable Pages



Wednesday, January 27, 2010
Bookable



                <h:link outcome="/page/welcome" value="testLink" includeViewParams="true" >
                	 ...
Bookable



                <h:button outcome="/page/welcome" value="testLink" includeViewParams="true" >
                ...
Scopes



Wednesday, January 27, 2010
Scopes



                          Request
                          Session
                          Application
      ...
Flows/Conversation



Wednesday, January 27, 2010
Flows


                              <flow id="loginFlow">
                                <views>
                      ...
Flows



                              <flow id="useradministrationFlow">
                                <views>
        ...
Flows

           <authoritySource>#{sessionBean.loginUserRole}</authoritySource>

           <accessDeniedPage>/page/acce...
Clean Code




Wednesday, January 27, 2010
DEMO



Wednesday, January 27, 2010
???


Wednesday, January 27, 2010
Java Server Faces 2.0 - Der Standard für moderne und komponentenbasierte Webanwendungen
Java Server Faces 2.0 - Der Standard für moderne und komponentenbasierte Webanwendungen
Upcoming SlideShare
Loading in...5
×

Java Server Faces 2.0 - Der Standard für moderne und komponentenbasierte Webanwendungen

2,387

Published on

JSF (JavaServer Faces) ist seit 2004 der Standard für komponentenbasierte Webanwendungen. Anfangs nur belächelt und als Intranetlösung abgetan, ist JSF heute eine stabile Grundlage, auch für Webanwendungen im Internet. Seit Juni 2009 ist mit JSR 314 die Version 2.0 fertig spezifiziert. Dieser Vortrag von Robert Reiz gibt eine kurze Einführung in die Grundlagen, einen kurzen geschichtlichen Rückblick und eine Einführung in die neuen Features von JSF 2.0.

Grundlagen und Rückblick
Vorstellung von JSF 2.0
Fazit

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,387
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Java Server Faces 2.0 - Der Standard für moderne und komponentenbasierte Webanwendungen

  1. 1. JSF 2.0 Robert Reiz Wednesday, January 27, 2010
  2. 2. Trainer Robert Reiz Dipl. Inf. (FH-Mannheim) Buch Mail-Travel-Agents auf Linux-Systemen Java-Projekte seit 2002 JSF-Erfahrung seit 2006 Gründung der PLOIN GmbH Jan. 2008 Trainer bei der GFU seit Dez. 2008 Wednesday, January 27, 2010
  3. 3. Trainer Comitter ploinFaces ploinMailFactory Blog http://www.robert-reiz.de Wednesday, January 27, 2010
  4. 4. Eine Presentation ist keine Dokumentation! Eine Presentation soll lediglich den Speaker bei seinem Vortrag unterstützen! Wednesday, January 27, 2010
  5. 5. Wer kennt JSF? Wednesday, January 27, 2010
  6. 6. Was ist JSF? Wednesday, January 27, 2010
  7. 7. Standards JSF 1.0 - JSR 127 - May 2004 JSF 1.2 - JSR 252 - May 2006 JSF 2.0 - JSR 314 - Julie 2009 Wednesday, January 27, 2010
  8. 8. Lifecycle Request Apply Request Process Restore View Values Validations Response Render Invoke Update Modell Response Applications Values Wednesday, January 27, 2010
  9. 9. JSF 1.2 xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" JSF 2.0 xmlns:ui="http://java.sun.com/jsf/facelets" jsf.js Wednesday, January 27, 2010
  10. 10. <h:selectOneListbox id="edit_workUnit_selectedProject" value="${managedBean[projectItem]}" style="width:200px; height:200px;" required="true"> <f:selectItems value="#{managedBean.projectList}"/> </h:selectOneListbox> <h:commandButton value="Speichern" actionListener="#{managedBean.doLoginListener}" action="#{loginBean.doLogin}" /> Wednesday, January 27, 2010
  11. 11. Wednesday, January 27, 2010
  12. 12. Implementierungen JSF-RI (mojarra) MyFaces-Core Wednesday, January 27, 2010
  13. 13. Flora und Fauna RichFaces IceFaces ADF Netadvantage Facelets Tomahawk Trinidad Orchestra PrimeFaces Tobago Woodstock ploinFaces Wednesday, January 27, 2010
  14. 14. Matrix http://www.jsfmatrix.net/ Wednesday, January 27, 2010
  15. 15. JSF 2.0 Wednesday, January 27, 2010
  16. 16. JSF 2.0 - Big changes XML-Freie Konfig. mit Annotationen Facelets ist der neue Standard Facelets-Comp. mit Interfaces/Impl. Standartisiertes AJAX Bookable links/buttons Wednesday, January 27, 2010
  17. 17. JSF 2.0 - Small changes Neue Scopes System-events Direkte Navigation ProjectStage Neue Methoden in der FacesContext .... Wednesday, January 27, 2010
  18. 18. Status Quo JSF 2.0 JSF-RI ploinFaces (mojarra) MyFaces-Core RichFaces IceFaces PrimeFaces Wednesday, January 27, 2010
  19. 19. Annotations Wednesday, January 27, 2010
  20. 20. @ManagedBean @RequestScoped public class LogInBean { private static final long serialVersionUID = 199L; private String loginName = "admin"; @ManagedProperty(name = "pass", value="admin") private String password; private String doNavigate(){ return "/page/welcome"; } } Wednesday, January 27, 2010
  21. 21. Facelets Wednesday, January 27, 2010
  22. 22. Facelets Nicht 1:1 übernommen Templating 15% schneller als JSP Einfache Komponentenentwicklung Schnittstelle für composite-components Wednesday, January 27, 2010
  23. 23. Facelets - Template layout.xhtml login.xhtml welcome.xhtml myData.xhtml Wednesday, January 27, 2010
  24. 24. Facelets - Template <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:head> <link rel="stylesheet" type="text/css" href="../css/layout.css" /> </h:head> <h:body> <div id="header" align="center"> <ui:insert name="header"> HEADER - ${title} </ui:insert> </div> <div id="content"> <ui:insert name="content"> Content </ui:insert> </div> <div id="footer" align="center"> <ui:insert name="footer" > FOOTER </ui:insert> </div> </h:body> </html> Wednesday, January 27, 2010
  25. 25. Facelets - Template <ui:composition template="/page/layout.xhtml"> <ui:param name="title" value="LOGIN SITE" /> <ui:define name="content"> ... Hier Inhalt </ui:define> </ui:composition> Wednesday, January 27, 2010
  26. 26. Facelets - Compon. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:composite="http://java.sun.com/jsf/composite"> <head><title>MyComponent</title></head> <body> <composite:interface> <composite:attribute name="title"/> </composite:interface> <composite:implementation> <div style="border: 1px soldi red"> <h1>#{cc.attrs.title}</h1> ... XHTML oder JSF-Komponenten </div> </composite:implementation> </body> </html> Wednesday, January 27, 2010
  27. 27. Facelets - Compon. <html xmlns:gfu="http://java.sun.com/jsf/composite/gfu"> <gfu:myComponent title="Panel-Header" /> Wednesday, January 27, 2010
  28. 28. Clean Code Wednesday, January 27, 2010
  29. 29. AJAX Wednesday, January 27, 2010
  30. 30. AJAX <f:ajax event="keyup" execute="@form" render="form:result" /> Wednesday, January 27, 2010
  31. 31. AJAX <h:form id="form"> <h:inputText value="#{welcomeBean.text}" > <f:ajax event="keyup" execute="@form" render="form:result" /> </h:inputText> <h:outputText id="result" value="#{welcomeBean.text}" /> </h:form> Wednesday, January 27, 2010
  32. 32. AJAX jsf.ajax.addOnError(callback) jsf.ajax.addOnEvent(callback) jsf.ajax.request(source, event, options) jsf.ajax.response(request, context) Wednesday, January 27, 2010
  33. 33. Resources Wednesday, January 27, 2010
  34. 34. Resources <h:outputStylesheet name="css/style.css" /> <h:outputScript name="jsf.js" libary="javax.faces" target="head" /> <h:graphicImage value="#{resource['lib:gfu.gif']}" /> Wednesday, January 27, 2010
  35. 35. [localePrefix/][libraryName/][libraryVersion/]resourceName[/resourceVersion] /META-INF/resources/compLib/script/compScript.js /resources/compLib/1.1/script/compScript.js Wednesday, January 27, 2010
  36. 36. Bookable Pages Wednesday, January 27, 2010
  37. 37. Bookable <h:link outcome="/page/welcome" value="testLink" includeViewParams="true" > <f:param name="userId" value="5" /> </h:link> <a href="/demoJsf2/page/welcome.jsf?userId=5">testLink</a> Wednesday, January 27, 2010
  38. 38. Bookable <h:button outcome="/page/welcome" value="testLink" includeViewParams="true" > <f:param name="userId" value="5" /> </h:button> <input type="button"  value="testLink"  onclick="window.location.href='/demoJsf2/page/welcome.jsf?userId=5'; return false;"/> Wednesday, January 27, 2010
  39. 39. Scopes Wednesday, January 27, 2010
  40. 40. Scopes Request Session Application Flash View Wednesday, January 27, 2010
  41. 41. Flows/Conversation Wednesday, January 27, 2010
  42. 42. Flows <flow id="loginFlow"> <views> <view>/login.xhtml</view> <view>/page/help/agbLogin.xhtml</view> <view>/page/help/haftungLogin.xhtml</view> </views> <attributes> <attribute>logInOutBean</attribute> </attributes> </flow> Wednesday, January 27, 2010
  43. 43. Flows <flow id="useradministrationFlow"> <views> <view>/page/useradmin.*</view> </views> <attributes> <attribute>useradminBean</attribute> <attribute>secureBean</attribute> </attributes> </flow> Wednesday, January 27, 2010
  44. 44. Flows <authoritySource>#{sessionBean.loginUserRole}</authoritySource> <accessDeniedPage>/page/accessDenied.xhtml</accessDeniedPage> <flow id="useradministrationFlow"> <views> <view>/page/useradmin.*</view> </views> <attributes> <attribute>useradminBean</attribute> <attribute>secureBean</attribute> </attributes> <includeAuthorities> <authority>Administrator</authority> <authority>GIS</authority> </includeAuthorities> </flow> Wednesday, January 27, 2010
  45. 45. Clean Code Wednesday, January 27, 2010
  46. 46. DEMO Wednesday, January 27, 2010
  47. 47. ??? Wednesday, January 27, 2010
  1. ¿Le ha llamado la atención una diapositiva en particular?

    Recortar diapositivas es una manera útil de recopilar información importante para consultarla más tarde.

×