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

on

  • 3,824 views

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 ...

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

Statistics

Views

Total Views
3,824
Views on SlideShare
3,789
Embed Views
35

Actions

Likes
0
Downloads
23
Comments
0

2 Embeds 35

http://www.slideshare.net 34
http://webcache.googleusercontent.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

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 Presentation Transcript

  • JSF 2.0 Robert Reiz Wednesday, January 27, 2010
  • 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
  • Trainer Comitter ploinFaces ploinMailFactory Blog http://www.robert-reiz.de Wednesday, January 27, 2010
  • Eine Presentation ist keine Dokumentation! Eine Presentation soll lediglich den Speaker bei seinem Vortrag unterstützen! Wednesday, January 27, 2010
  • 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 - May 2006 JSF 2.0 - JSR 314 - Julie 2009 Wednesday, January 27, 2010
  • Lifecycle Request Apply Request Process Restore View Values Validations Response Render Invoke Update Modell Response Applications Values Wednesday, January 27, 2010
  • 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
  • <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
  • Wednesday, January 27, 2010
  • Implementierungen JSF-RI (mojarra) MyFaces-Core Wednesday, January 27, 2010
  • Flora und Fauna RichFaces IceFaces ADF Netadvantage Facelets Tomahawk Trinidad Orchestra PrimeFaces Tobago Woodstock ploinFaces Wednesday, January 27, 2010
  • 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 Facelets ist der neue Standard Facelets-Comp. mit Interfaces/Impl. Standartisiertes AJAX Bookable links/buttons Wednesday, January 27, 2010
  • JSF 2.0 - Small changes Neue Scopes System-events Direkte Navigation ProjectStage Neue Methoden in der FacesContext .... Wednesday, January 27, 2010
  • Status Quo JSF 2.0 JSF-RI ploinFaces (mojarra) MyFaces-Core RichFaces IceFaces PrimeFaces Wednesday, January 27, 2010
  • Annotations Wednesday, January 27, 2010
  • @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
  • Facelets Wednesday, January 27, 2010
  • Facelets Nicht 1:1 übernommen Templating 15% schneller als JSP Einfache Komponentenentwicklung Schnittstelle für composite-components Wednesday, January 27, 2010
  • Facelets - Template layout.xhtml login.xhtml welcome.xhtml myData.xhtml Wednesday, January 27, 2010
  • 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
  • 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
  • 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
  • Facelets - Compon. <html xmlns:gfu="http://java.sun.com/jsf/composite/gfu"> <gfu:myComponent title="Panel-Header" /> Wednesday, January 27, 2010
  • Clean Code Wednesday, January 27, 2010
  • AJAX Wednesday, January 27, 2010
  • AJAX <f:ajax event="keyup" execute="@form" render="form:result" /> Wednesday, January 27, 2010
  • 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
  • AJAX jsf.ajax.addOnError(callback) jsf.ajax.addOnEvent(callback) jsf.ajax.request(source, event, options) jsf.ajax.response(request, context) Wednesday, January 27, 2010
  • Resources Wednesday, January 27, 2010
  • 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
  • [localePrefix/][libraryName/][libraryVersion/]resourceName[/resourceVersion] /META-INF/resources/compLib/script/compScript.js /resources/compLib/1.1/script/compScript.js Wednesday, January 27, 2010
  • Bookable Pages Wednesday, January 27, 2010
  • 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
  • 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
  • Scopes Wednesday, January 27, 2010
  • Scopes Request Session Application Flash View Wednesday, January 27, 2010
  • Flows/Conversation Wednesday, January 27, 2010
  • 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
  • Flows <flow id="useradministrationFlow"> <views> <view>/page/useradmin.*</view> </views> <attributes> <attribute>useradminBean</attribute> <attribute>secureBean</attribute> </attributes> </flow> Wednesday, January 27, 2010
  • 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
  • Clean Code Wednesday, January 27, 2010
  • DEMO Wednesday, January 27, 2010
  • ??? Wednesday, January 27, 2010