Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaServer Faces Peter Norrhall. 2007-02-07JavaServer Faces Internet - Möjliggöraren.

Similar presentations


Presentation on theme: "JavaServer Faces Peter Norrhall. 2007-02-07JavaServer Faces Internet - Möjliggöraren."— Presentation transcript:

1 JavaServer Faces Peter Norrhall

2 JavaServer Faces Internet - Möjliggöraren

3 JavaServer Faces Internet för användare

4 JavaServer Faces Internet för utvecklare Det suger!!!

5 JavaServer Faces Bra för konsulter € € € € € € € € € € € €

6 JavaServer Faces Dåligt på lång sikt

7 JavaServer Faces Java GUI Business Data JPA EJB 3 JavaServer Faces GWT

8 JavaServer Faces

9 JavaServer Faces Managed Beans SearchBean {... private String searchInput public String search() {... } Managed Beans Action

10 JavaServer Faces Managed Beans - DI

11 JavaServer Faces Navigering SearchBean {... String searchInput String search() {... return ”result”; } Managed Beans

12 JavaServer Faces Navigering

13 JavaServer Faces Demo

14 JavaServer Faces JSF - Livscykeln Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events SearchBean {... String searchInput String search() {... } Managed Beans UIViewRoot HtmlForm HtmlMessage HtmlInputText HtmlCommandButton UI Component Tree

15 JavaServer Faces Restore View UIViewRoot HtmlForm HtmlMessage HtmlInputText HtmlCommandButton UI Component Tree Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events

16 JavaServer Faces Apply Request Values UIViewRoot HtmlForm HtmlMessage HtmlInputText HtmlCommandButton UI Component Tree Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events Multi*

17 JavaServer Faces Process Validations SearchBean {... String searchInput String search() {... } Managed Beans UIViewRoot HtmlForm HtmlMessage HtmlInputText HtmlCommandButton UI Component Tree Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events Multi*

18 JavaServer Faces Update Model Values SearchBean {... String searchInput String search() {... } Managed Beans UIViewRoot HtmlForm HtmlMessage HtmlInputText HtmlCommandButton UI Component Tree Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events Multi*

19 JavaServer Faces Invoke Application UIViewRoot HtmlForm Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events HtmlMessage HtmlInputText HtmlCommandButton SearchBean {... List result String searchInput String search() {... } Managed BeansUI Component Tree Multi*

20 JavaServer Faces Render Response Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events UIViewRoot HtmlDataTable UIColumn HtmlInputText UI Component Tree UIColumn HtmlInputText UIColumn HtmlInputText SearchBean {... List result String searchInput String search() {... } Managed Beans

21 JavaServer Faces Nyheterna i JSF 1.2 < Jsp 2.1< Jsf 1.2

22 JavaServer Faces Unified EL •#{searchBean.inputString} - deferred •${searchBean.inputString} – immediate •Implicita objekt (application, cookie,...) •Operatorer (+.-,*,/,%,A?B:C,==,!=,...) •Uttryck (#{searchBean.search})

23 JavaServer Faces Nyheter i Jsf Sammanfattning •http://java.sun.com/developer/technicalArt icles/J2EE/jsf_12

24 JavaServer Faces Verktyg Oracle JDeveloper NetBeans Java Studio Creator Exadel Studio JBuilder SAP Developer Studio BEA Workshop IntelliJ IDEA Websphere Studio

25 JavaServer Faces Komponentbibliotek •JSF •MyFaces Extensions •Apache Tobago/ADF Faces (Oracle) •ICEFaces •Netadvantage for JSF •BackBase •RichFaces (Ajax4JSF)

26 JavaServer Faces Förändra/skapa komponenter

27 JavaServer Faces Förändra komponenter •Egenskaper •CSS Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events

28 JavaServer Faces JSF – Uttöka en komponent Restore View Apply Request Values Process Validations Update Model Values Process Events Invoke Application Render Response Process Events Process Events Process Events public void validate (FacesContext context, UIComponent toValidate, Object value) { String = (String) value; if == -1) { ((UIInput)toValidate).setValid(false); FacesMessage message = new FacesMessage("Invalid "); context.addMessage(toValidate.getClientId(context), message); } }

29 JavaServer Faces Skapa en komponent

30 JavaServer Faces JSF och Ajax •Komponentbibliotek •Sun Blueprint AJAX components •Ajax4JSF •Seam Remoting

31 JavaServer Faces Ajax4Jsf – a4j:support

32 JavaServer Faces Ajax4Jsf – CommandButton

33 JavaServer Faces Ajax4Jsf •

34 JavaServer Faces IceFaces

35 JavaServer Faces JSF Ramverk •Apache Shale vs JBoss Seam – Dialog Manager (Conversation) – Validation – Remoting (Ajax) – Clay (Non-Jsp) –...

36 JavaServer Faces JBoss Seam SearchBean {... List result String searchInput String search() {... } public class SearchBean implements String searchInput String search() {... } EJB 3

37 JavaServer Faces Annoteringar – Bokmärken •A RESTful framework public class CategoryBean String public String getCategory() { category = em.find(Category.class, catId); }

38 JavaServer Faces JSF - Bokmärken category se.movlin.jsf.pagebeans.CategoryBean request catId java.lang.String #{param.catId} public class CategoryBean { private String catId; public void setCatId(String catId) { this.catId = catId; category = em.find(Category.class, catId); } }

39 JavaServer - Validering public class public String get () { return ; } public void set (String ) { this. = ; } }

40 JavaServer Faces Seam – Ajax public interface Search public String suggest(String name); public class SearchAction implements Search { public String suggest(String name) { String suggestion = null;... return suggestion; } // get the remote Search var search = Seam.Component.getInstance(”search”); function suggest(name) { search.suggest(name, suggestCallback); } function suggestCallback(suggestion) { form.suggestion.value = suggestion; }

41 JavaServer Faces JBoss Seam •Fogar samman JSF och EJB 3 (Web Beans) – Ut med XML-konfig •AJAX för en bättre värld •Conversation – Stöd för tillståndsfulla multipla ”konversationer”

42 JavaServer Faces Seam – Web Beans •Web Beans JSR 299

43 JavaServer Faces Facelets

44 JavaServer Faces Facelets - Våga Vägra JSP!

45 JavaServer Faces Facelets - Mallbaserat bottom top rightcontainer template.xhtml.top{ margin: 0px; padding: 0px; height: 58px; width: 770px; font: 20px Verdana, Tahoma, Arial text-decoration-none }.right {... }.bottom {... }.container {... } template.css

46 JavaServer Faces Produktkatalog ShoppingCart/CompanyInfo (bottom) Menu (top) Branding (right) container

47 JavaServer Faces Produktkatalog catalog_template.xhtml product.xhtml

48 JavaServer Faces Facelets – enklare att •Skapa egna komponenter •Skapa valideringsfunktioner •Skapa ”taggar” •Skicka parametrar mellan sidor •Exadel Studio

49 JavaServer Faces Prestanda

50 JavaServer Faces State – Client vs Server Web.xml javax.faces.STATE_SAVING_METHOD client jsfsearch.jsp

51 JavaServer Faces Cache is King

52 JavaServer Faces JSF 2.0 •Web Beans JSR JBoss •Oracles JSR för att uttöka designtime stödet i GUIbyggare •http://www.jsfcentral.com/listings/A10880 ?linkhttp://www.jsfcentral.com/listings/A10880 ?link

53 JavaServer Faces Summering


Download ppt "JavaServer Faces Peter Norrhall. 2007-02-07JavaServer Faces Internet - Möjliggöraren."

Similar presentations


Ads by Google