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 2007-02-07JavaServer Faces Internet - Möjliggöraren

3 2007-02-07JavaServer Faces Internet för användare

4 2007-02-07JavaServer Faces Internet för utvecklare Det suger!!!

5 2007-02-07JavaServer Faces Bra för konsulter € € € € € € € € € € € €

6 2007-02-07JavaServer Faces Dåligt på lång sikt

7 2007-02-07JavaServer Faces Java GUI Business Data JPA EJB 3 JavaServer Faces GWT

8 2007-02-07JavaServer Faces

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

10 2007-02-07JavaServer Faces Managed Beans - DI

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

12 2007-02-07JavaServer Faces Navigering

13 2007-02-07JavaServer Faces Demo

14 2007-02-07JavaServer 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 2007-02-07JavaServer 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 2007-02-07JavaServer 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 2007-02-07JavaServer 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 2007-02-07JavaServer 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 2007-02-07JavaServer 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 2007-02-07JavaServer 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 2007-02-07JavaServer Faces Nyheterna i JSF 1.2 < Jsp 2.1< Jsf 1.2

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

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

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

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

26 2007-02-07JavaServer Faces Förändra/skapa komponenter

27 2007-02-07JavaServer 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 2007-02-07JavaServer 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 validateEmail(FacesContext context, UIComponent toValidate, Object value) { String email = (String) value; if (email.indexOf('@') == -1) { ((UIInput)toValidate).setValid(false); FacesMessage message = new FacesMessage("Invalid Email"); context.addMessage(toValidate.getClientId(context), message); } }

29 2007-02-07JavaServer Faces Skapa en komponent

30 2007-02-07JavaServer Faces JSF och Ajax •Komponentbibliotek •Sun Blueprint AJAX components •Ajax4JSF •Seam Remoting

31 2007-02-07JavaServer Faces Ajax4Jsf – a4j:support

32 2007-02-07JavaServer Faces Ajax4Jsf – CommandButton

33 2007-02-07JavaServer Faces Ajax4Jsf •

34 2007-02-07JavaServer Faces IceFaces

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

36 2007-02-07JavaServer Faces JBoss Seam SearchBean {... List result String searchInput String search() {... } Managed Beans @Stateless @Name(”searchBean”) public class SearchBean implements Search{ @Out List result; @In @Out String searchInput String search() {... } EJB 3

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

38 2007-02-07JavaServer 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 2007-02-07JavaServer Faces @Annoteringar - Validering public class UserRegistrationBean { @NotNull @Email public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } }

40 2007-02-07JavaServer Faces Seam – Ajax Remoting @Local public interface Search { @WebRemote public String suggest(String name); } @Name(”search”) 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 2007-02-07JavaServer Faces JBoss Seam •Fogar samman JSF och EJB 3 (Web Beans) •@Annoteringar – Ut med XML-konfig •AJAX för en bättre värld •Conversation – Stöd för tillståndsfulla multipla ”konversationer”

42 2007-02-07JavaServer Faces Seam – Web Beans •Web Beans JSR 299

43 2007-02-07JavaServer Faces Facelets

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

45 2007-02-07JavaServer 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 2007-02-07JavaServer Faces...... Produktkatalog ShoppingCart/CompanyInfo (bottom) Menu (top) Branding (right) container { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/8/2011249/slides/slide_46.jpg", "name": "2007-02-07JavaServer Faces......", "description": "Produktkatalog ShoppingCart/CompanyInfo (bottom) Menu (top) Branding (right) container

47 2007-02-07JavaServer Faces Produktkatalog catalog_template.xhtml product.xhtml

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

49 2007-02-07JavaServer Faces Prestanda

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

51 2007-02-07JavaServer Faces Cache is King { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/8/2011249/slides/slide_51.jpg", "name": "2007-02-07JavaServer Faces Cache is King

52 2007-02-07JavaServer Faces JSF 2.0 •Web Beans JSR 299 - 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 2007-02-07JavaServer Faces Summering


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

Similar presentations


Ads by Google