Your SlideShare is downloading. ×
0
Facelets letting go of JavaServer™ Pages
Outline <ul><li>Evolution of Web Frameworks </li></ul><ul><li>Facelets </li></ul><ul><ul><li>Overview </li></ul></ul><ul><...
Evolution of Web Frameworks <ul><li>Servlets - 1997 </li></ul><ul><li>Procedural JSP - 1999 </li></ul><ul><li>Composition ...
Facelets: Overview <ul><li>Composition and Component </li></ul><ul><li>View Handler for JSF </li></ul><ul><li>Throws out J...
Demo Hello World and Code
Facelets: Dependencies <ul><li>[application root]  </li></ul><ul><ul><li>WEB-INF  </li></ul></ul><ul><ul><ul><li>Classes <...
Facelets: web.xml <ul><li><web-app>  </li></ul><ul><li><!-- Use Documents Saved as *.xhtml -->   </li></ul><ul><li><contex...
Facelets: faces-config.xml <ul><li><faces-config>  </li></ul><ul><li>… </li></ul><ul><li><application>  </li></ul><ul><li>...
Facelets: Managed Bean <ul><li>package com.vallettas.facelets.demo; </li></ul><ul><li>public class Login { </li></ul><ul><...
Facelets: xhtml Template <ul><li><!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www...
Facelets: xhtml Composition <ul><li><!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://...
Ajax Support <ul><li>Swim lane approach to Ajax </li></ul><ul><ul><li>Every widget for himself </li></ul></ul><ul><li>JSF ...
Evolving JavaServer™ Faces Technology: Ajax Done Right – Slide 21 - 35 Edward Burns Jacob Hookom Adam Winer
Scalability/Performance <ul><li>Better than JavaServer™ Pages using JSP </li></ul><ul><ul><li>5% - 33% faster </li></ul></ul>
Support <ul><li>Tool Support </li></ul><ul><ul><li>Exadel Studio </li></ul></ul><ul><ul><li>XML/XHTML Support </li></ul></...
Support <ul><li>Industry Support </li></ul><ul><li>? </li></ul>
Support <ul><li>Technical Support </li></ul><ul><li>https://facelets.dev.java.net </li></ul><ul><li>Google returns 133,000...
Developer Velocity <ul><li>Better than JavaServer™ Pages using JSP </li></ul><ul><ul><li>30% - 500% faster </li></ul></ul>...
Recommended Reading <ul><li>Articles </li></ul><ul><ul><li>Improving JSF by Dumping JSP  - Hans Bergsten http://www.onjava...
Upcoming SlideShare
Loading in...5
×

Facelets

1,885

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,885
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
101
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Facelets"

  1. 1. Facelets letting go of JavaServer™ Pages
  2. 2. Outline <ul><li>Evolution of Web Frameworks </li></ul><ul><li>Facelets </li></ul><ul><ul><li>Overview </li></ul></ul><ul><ul><li>Syntax </li></ul></ul><ul><ul><li>Demo </li></ul></ul><ul><ul><li>AJAX Support </li></ul></ul><ul><ul><li>Scalability/Performance </li></ul></ul><ul><ul><li>Support </li></ul></ul><ul><li>Wrap-up </li></ul><ul><ul><li>Recommended Reading </li></ul></ul>
  3. 3. Evolution of Web Frameworks <ul><li>Servlets - 1997 </li></ul><ul><li>Procedural JSP - 1999 </li></ul><ul><li>Composition Frameworks </li></ul><ul><ul><li>Tapestry </li></ul></ul><ul><ul><li>2000 </li></ul></ul><ul><li>Action Frameworks </li></ul><ul><ul><li>Struts </li></ul></ul><ul><ul><li>2001 </li></ul></ul><ul><li>Component Frameworks </li></ul><ul><ul><li>JavaServer™ Faces </li></ul></ul><ul><ul><li>2004 </li></ul></ul>
  4. 4. Facelets: Overview <ul><li>Composition and Component </li></ul><ul><li>View Handler for JSF </li></ul><ul><li>Throws out JSP </li></ul>
  5. 5. Demo Hello World and Code
  6. 6. Facelets: Dependencies <ul><li>[application root] </li></ul><ul><ul><li>WEB-INF </li></ul></ul><ul><ul><ul><li>Classes </li></ul></ul></ul><ul><ul><ul><li>lib </li></ul></ul></ul><ul><ul><ul><ul><li>jsf-facelets.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>el-api.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>el-ri.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>jsf-api.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>jsf-impl.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>commons-digester.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>commons-logging.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>commons-collections.jar </li></ul></ul></ul></ul><ul><ul><ul><ul><li>commons-beanutils.jar </li></ul></ul></ul></ul><ul><ul><ul><li>web.xml </li></ul></ul></ul><ul><ul><ul><li>faces-config.xml </li></ul></ul></ul><ul><ul><li>[xhtml documents] </li></ul></ul>
  7. 7. Facelets: web.xml <ul><li><web-app> </li></ul><ul><li><!-- Use Documents Saved as *.xhtml --> </li></ul><ul><li><context-param> </li></ul><ul><li><param-name> javax.faces.DEFAULT_SUFFIX </param-name> </li></ul><ul><li><param-value >.xhtml </param-value> </li></ul><ul><li></context-param> </li></ul><ul><li><!-- Faces Servlet --> </li></ul><ul><li><servlet> </li></ul><ul><li><servlet-name>Faces Servlet</servlet-name> </li></ul><ul><li><servlet-class>javax.faces.webapp.FacesServlet</servlet-class> </li></ul><ul><li><load-on-startup>1</load-on-startup> </li></ul><ul><li></servlet> </li></ul><ul><li><!-- Faces Servlet Mapping --> </li></ul><ul><li><servlet-mapping> </li></ul><ul><li><servlet-name>Faces Servlet</servlet-name> </li></ul><ul><li><url-pattern>*.jsf</url-pattern> </li></ul><ul><li></servlet-mapping> </li></ul><ul><li>… </li></ul><ul><li></web-app> </li></ul>
  8. 8. Facelets: faces-config.xml <ul><li><faces-config> </li></ul><ul><li>… </li></ul><ul><li><application> </li></ul><ul><li><view-handler> </li></ul><ul><li>com.sun.facelets.FaceletViewHandler </view-handler> </li></ul><ul><li></application> </li></ul><ul><li>… </li></ul><ul><li></faces-config> </li></ul>
  9. 9. Facelets: Managed Bean <ul><li>package com.vallettas.facelets.demo; </li></ul><ul><li>public class Login { </li></ul><ul><li>private String username; </li></ul><ul><li>private String password; </li></ul><ul><li>public String getUsername() { </li></ul><ul><li>return username; </li></ul><ul><li>} </li></ul><ul><li>public void setUsername(String username) { </li></ul><ul><li>this.username = username; </li></ul><ul><li>} </li></ul><ul><li>public String getPassword() { </li></ul><ul><li>return password; </li></ul><ul><li>} </li></ul><ul><li>public void setPassword(String password) { </li></ul><ul><li>this.password = password; </li></ul><ul><li>} </li></ul><ul><li>public String login() { </li></ul><ul><li>return &quot;success&quot;; </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  10. 10. Facelets: xhtml Template <ul><li><!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> </li></ul><ul><li><html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot;> </li></ul><ul><li><head> </li></ul><ul><li><title>Facelets Demo</title> </li></ul><ul><li><link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; /> </li></ul><ul><li></head> </li></ul><ul><li><body> </li></ul><ul><li><img src=&quot;images/ldslogo.gif&quot; border=&quot;0&quot; /> </li></ul><ul><li><div> </li></ul><ul><li><ui:insert name=&quot;login&quot;> </li></ul><ul><li>Login goes here </li></ul><ul><li></ui:insert> </li></ul><ul><li></div> </li></ul><ul><li></body> </li></ul><ul><li></html> </li></ul>
  11. 11. Facelets: xhtml Composition <ul><li><!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> </li></ul><ul><li><html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; </li></ul><ul><ul><li>xmlns:ui=&quot;http://java.sun.com/jsf/facelets&quot; </li></ul></ul><ul><ul><li>xmlns:h=&quot;http://java.sun.com/jsf/html&quot; </li></ul></ul><ul><ul><li>xmlns:f=&quot;http://java.sun.com/jsf/core&quot;> </li></ul></ul><ul><li><body> </li></ul><ul><ul><li><ui:composition template=&quot;/SimpleTemplate.xhtml&quot;> </li></ul></ul><ul><ul><ul><li><ui:define name=&quot;title&quot;> </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><ul><li></ui:define> </li></ul></ul></ul><ul><ul><ul><li><ui:define name=&quot;login&quot;> </li></ul></ul></ul><ul><ul><ul><ul><li><f:loadBundle basename=&quot;com.vallettas.facelets.demo.login&quot; var=&quot;msg&quot; /> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><h:form id=&quot;login&quot;> </li></ul></ul></ul></ul><ul><ul><ul><ul><li><h:panelGrid columns=&quot;2&quot; align=&quot;center&quot;> </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><h:outputText value=&quot;#{msg.username}&quot; /> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><h:inputText value=&quot;#{LoginBean.username}&quot; /> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><h:outputText value=&quot;#{msg.password}&quot; /> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><h:inputSecret value=&quot;#{LoginBean.password}&quot; /> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li><h:commandButton action=&quot;#{LoginBean.login}&quot; value=&quot;Login&quot; /> </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><li></h:panelGrid> </li></ul></ul></ul></ul><ul><ul><ul><ul><li></h:form> </li></ul></ul></ul></ul><ul><ul><ul><li></ui:define> </li></ul></ul></ul><ul><ul><li></ui:composition> </li></ul></ul><ul><ul><li></body> </li></ul></ul><ul><li></html> </li></ul>
  12. 12. Ajax Support <ul><li>Swim lane approach to Ajax </li></ul><ul><ul><li>Every widget for himself </li></ul></ul><ul><li>JSF Mediation approach </li></ul><ul><ul><li>A widget can affect multiple parts </li></ul></ul><ul><ul><li>Logic stays in Java </li></ul></ul><ul><ul><li>… but what about the performance implications of reconstituting the JSF tree after every… </li></ul></ul>
  13. 13. Evolving JavaServer™ Faces Technology: Ajax Done Right – Slide 21 - 35 Edward Burns Jacob Hookom Adam Winer
  14. 14. Scalability/Performance <ul><li>Better than JavaServer™ Pages using JSP </li></ul><ul><ul><li>5% - 33% faster </li></ul></ul>
  15. 15. Support <ul><li>Tool Support </li></ul><ul><ul><li>Exadel Studio </li></ul></ul><ul><ul><li>XML/XHTML Support </li></ul></ul><ul><ul><ul><li>Eclipse </li></ul></ul></ul><ul><ul><ul><li>IntelliJ IDEA </li></ul></ul></ul><ul><ul><ul><li>NetBeans </li></ul></ul></ul><ul><ul><ul><li>JBuilder </li></ul></ul></ul><ul><ul><ul><li>JDeveloper </li></ul></ul></ul><ul><ul><ul><li>… </li></ul></ul></ul>
  16. 16. Support <ul><li>Industry Support </li></ul><ul><li>? </li></ul>
  17. 17. Support <ul><li>Technical Support </li></ul><ul><li>https://facelets.dev.java.net </li></ul><ul><li>Google returns 133,000 results – it’s a start </li></ul><ul><ul><li>1.0 release - Nov 14, 2005 </li></ul></ul>
  18. 18. Developer Velocity <ul><li>Better than JavaServer™ Pages using JSP </li></ul><ul><ul><li>30% - 500% faster </li></ul></ul><ul><ul><ul><li>Little to no tool support </li></ul></ul></ul><ul><ul><li>Source for statistics </li></ul></ul><ul><ul><ul><li>Dan Harmer 30%-40% </li></ul></ul></ul><ul><ul><ul><li>Mike Youngstrom 5x </li></ul></ul></ul><ul><ul><ul><li>Matt Wheeler 2x </li></ul></ul></ul><ul><ul><ul><li>Stephan Heilner 2x </li></ul></ul></ul><ul><ul><ul><li>Monal Daxini 2x </li></ul></ul></ul><ul><ul><ul><li>Me 30%-50% </li></ul></ul></ul>
  19. 19. Recommended Reading <ul><li>Articles </li></ul><ul><ul><li>Improving JSF by Dumping JSP - Hans Bergsten http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html </li></ul></ul><ul><ul><li>Facelets fits JSF like a glove – Richard Hightower http://www-128.ibm.com/developerworks/java/library/j-facelets/ </li></ul></ul><ul><ul><li>Inside Facelets Part 1: An Introduction – Jacob Hookom http://www.jsfcentral.com/articles/facelets_1.html </li></ul></ul><ul><ul><li>Facelets Developer Documentation – Jacob Hookom https://facelets.dev.java.net/nonav/docs/dev/docbook.html </li></ul></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×