Burns jsf-confess-2015

37
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. | What's Next For JSF Ed Burns JSF Specification co-lead Oracle America, Inc.

Transcript of Burns jsf-confess-2015

Page 1: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

What's  Next  For  JSF  Ed Burns JSF Specification co-lead Oracle America, Inc.

Page 2: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Safe  Harbor  Statement  The  following  is  intended  to  outline  our  general  product  direcGon.  It  is  intended  for  informaGon  purposes  only,  and  may  not  be  incorporated  into  any  contract.  It  is  not  a  commitment  to  deliver  any  material,  code,  or  funcGonality,  and  should  not  be  relied  upon  in  making  purchasing  decisions.  The  development,  release,  and  Gming  of  any  features  or  funcGonality  described  for  Oracle’s  products  remains  at  the  sole  discreGon  of  Oracle.  

M  

Page 3: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

My  Plan  for  Your  Time  Investment  

UI  trends  

What  does  this  mean  for  JSF?  

What  about  Java  EE  8?  

Preserving  your  investment  in  JSF  

JSF  2.3  New  Features  Done  to  Date  

Q&A  

 

1

2

3

4

5

E  

6

Page 4: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  E  

Page 5: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

• Mobile  is  now  more  important  than  desktop  • What  kind  of  app?  – Mobile  Web  – NaGve  App  (Android,  iOS,  Windows)  

•  Lots  of  help  out  there  – twi\er  bootstrap  and  its  enablers  

Mobile  First  Web  Design  

E  

Page 6: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  E  

DEPARTMENT  OF  STATE  

Page 7: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  E  

Page 8: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

MEAN  E  

Page 9: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

• MongoDB  • ExpressJS  • AngularJS  • Node.js  

E  

Page 10: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Trying  out  MEAN?  

JSF  

Page 11: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Wir  sind  für  Sie  da  

•  Enterprise  •  Stable  •  Trusted  vendors  with  a  proven  track  record  of  not  abandoning  projects  • Open  Standard  Process    

Con8nued  Relevance  of  JSF  

Page 12: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

What  Does  All  This  Mean  for  JSF?  • Mobile  – Use  a  mobile  opGmized  JSF  component  library  

•  State  – Design  for  statelessness  •  JavaScript  – SGll  held  at  arm’s  length  – A  component  level  concern  

E  

Page 13: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

What  Does  All  This  Mean  for  JSF?  What  about  the  MVC  JSR?  

UI  Component  Oriented  MVC  

M  

Page 14: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

What  Does  All  This  Mean  for  JSF?  What  about  the  MVC  JSR?  

Ac8on  Oriented  MVC  

M  

Page 15: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

What  About  the  MVC  JSR?  

•  Facelets  •  Scopes  – Flow  – Flash  – View  Scope  

Alignment  between  JSF  and  MVC  

M  

Page 16: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

•  1.0  – Managed  Beans  – EL  – Component  Model  

•  2.0  – Ajax  – Facelets  – Composite  Components  

•  2.2  – HTML5  Friendly  Markup  – Resource  Library  Contracts  – Faces  Flows  – File  Upload  •  2.3  (Planned)  – Be\er  CDI  IntegraGon  – MVC  capability  – <f:socket>  WebSocket  

JSF  Greatest  Hits  Over  the  Years  

Page 17: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

WebSocket  and  JSF  

DEMO  

Page 18: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

•  Tie  up  the  loose  ends  – SpecificaGon  clarificaGons  – CDI  alignment  •  Ease  of  use  e.g.  @Inject  FacesContext  • @Inject  into  Validators,  Converters,  etc.  

– HtmlInputHidden  is  ClientBehaviorHolder  

•  Small  scale  new  features  

•  Subject  to  Spec  Lead  oversight  – JSON  ajax  component  rendering  – Stateless  enhancements  – GET  enhancements  – Adopt-­‐a-­‐JSR  support  

JSF  2.3  in  Java  EE  8  Two  feature  drivers,  each  with  their  own  agenda  

M  

Page 19: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

JSF  2.3  Small  Scale  New  Features  •  End  of  the  line  for  non-­‐CDI  managed  beans  – Redefine  meaning  of  @javax.faces.bean.ManagedBean  to  be  CDI  bean  – Redefine  corresponding  XML  syntax  to  be  CDI  bean  

• Ajax  method  invocaGon  – A  Faces  request  – Not  specific  to  a  view  – Is  specific  to  a  ClientWindow  – Returns  results  in  JSON  

M  

Page 20: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Preserving  Your  Investment  In  JSF  JSF  2.2  New  Feature  Recap  

Page 21: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

JSF  2.2  Big  Ticket  Features  • Markup  EvoluGon  – 1090  HTML5  Friendly  Markup  

• MulG-­‐tenancy  and  Modularity  – 730  Flows  – 1142  Resource  Library  Contracts  

Page 22: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

•  Just  Passing  Through  

HTML5  Friendly  Markup  

Bullet  Through  Jack,  1964  ©  Dr  Harold  Edgerton  

Page 23: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

1090  HTML5  Friendly  Markup  

•  This  is  a  JSF  page    

The  best  part  of  Wicket  comes  to  JSF  

<!DOCTYPE html>!<html xmlns="http://www.w3.org/1999/xhtml"! xmlns:myNS="http://xmlns.jcp.org/jsf”>!<form myNS:id="form">! <input name="textField" type="text" myNS:value="#{bean.text1}" />! <input type="submit" myNS:id="submitButton" value="submit" /> ! <p>submitted text: #{bean.text1}.</p>!</form>!</html>!!

Page 24: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

1090  HTML5  Friendly  Markup  

• Before  JSF  2.2  – JSF  tags  hide  complexity  of  underlying  HTML+script+css+images  – JSF  “Renderer”:    •  encode:  markup  to  browser  •  decode:  name=value  from  browser  

<html>… <my:colorPicker value=“#{colorBean.color2}” /> <my:calendar value=“#{calendarBean.date1}” />

</html>

• Context:  Missing  feature  in  browser?  Write  a  JSF  component.  

Let  the  elegance  of  HTML  shine  through  

Page 25: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

1090  HTML5  Friendly  Markup  

• With  JSF  2.2  – Pure  HTML+script+css+images  in  the  JSF  page  – JSF  Renderer  handles  decode  from  browser  •  Leverage  the  strength  of  the  JSF  lifecycle  •  Leverage  the  expressiveness  of  HTML5  

<html>… <input type=“color” jsf:value=“#{colorBean.color2}”/> <input type=“date” jsf:value=“#{calendarBean.date1}” />

</html>

• Context:  New  feature  in  browser?  Use  “pass  through  elements”  

Let  the  elegance  of  HTML  shine  through  

Page 26: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

1142  Resource  Library  Contracts  730  Faces  Flows      

• Allow  composing  a  JSF  app  as  a  collecGon  of  modules  – Faces  Flows  modularize  behavior  – Resource  Library  Contracts  modularize  appearance  

• Well  defined  contract  for  each  

Modularity and Multi-tenant capability  

Page 27: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Resource  Library  Contracts  Facelets  Review   The Facelets Gazette

SiteNavigation

●Events

●Docs

●Forums

About Contact Site Map

Template File name _template.html

Insertion points

Resourcescss classes, scripts, images

Page 28: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Resource  Library  Contracts  A  Contract  is  Born  

• Declared Templates• Declared Insertion Points• Declared Resources

contractA

Page 29: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Resource  Library  Contracts  Loading  ConvenGons  

contractA

• Declared Templates• Declared Insertion Points• Declared Resources

contractB

• Declared Templates• Declared Insertion Points• Declared Resources

contractC

• Declared Templates• Declared Insertion Points• Declared Resources

<web-app-root>/contracts

Page 30: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Resource  Library  Contracts  Loading  ConvenGons  

contractA

• Declared Templates• Declared Insertion Points• Declared Resources

contractB

• Declared Templates• Declared Insertion Points• Declared Resources

contractC

• Declared Templates• Declared Insertion Points• Declared Resources

<web-app-root>/contractscontractD

• Declared Templates• Declared Insertion Points• Declared Resources

contractE

• Declared Templates• Declared Insertion Points• Declared Resources

contractF

• Declared Templates• Declared Insertion Points• Declared Resources

JAR files in WEB-INF/lib

Page 31: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Resource  Library  Contracts  Loading  ConfiguraGon  

contractA

• Declared Templates• Declared Insertion Points• Declared Resources

contractB

• Declared Templates• Declared Insertion Points• Declared Resources

contractC

• Declared Templates• Declared Insertion Points• Declared Resources

<web-app-root>/contractscontractD

• Declared Templates• Declared Insertion Points• Declared Resources

contractE

• Declared Templates• Declared Insertion Points• Declared Resources

contractF

• Declared Templates• Declared Insertion Points• Declared Resources

JAR files in WEB-INF/lib

Set of available contracts

Facelet 1<f:view contracts="contractA">

...

Facelet 3Facelet 2

faces-config.xml

Page 32: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Flow  NavigaGon  

• NavigaGon  is  no  longer  just  between  pages  • NavigaGon  is  now  between  flow  “nodes”  •  InformaGon  Hiding  comes  to  JSF.  Welcome  to  1972!  • MulGple  node  types:  – View  – Method  Call  – Switch  – Flow  Call  – Flow  Return  

Page 33: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Flow  DefiniGon  

• Name  of  the  flow  • Where  does  the  flow  start?  •  Input  values  • OpGonal  iniGalizer  &  finalizer  

Page 34: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

JSF  2.3  New  Features  Done  to  Date  

• UIRepeat  and  UIData  support  Map  and  Iterable  • New  Event:  PostRenderViewEvent  • @Inject  support  fort  – RequestCookieMap  – View  Map,  Session  Map  – FacesConverter  – FacesBehavior  – FacesValidator  • CDI  #{viewScoped}  

Page 35: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Thank  You!  

•  Feedback  to  @edburns  

Page 36: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |  

Safe  Harbor  Statement  The  preceding  is  intended  to  outline  our  general  product  direcGon.  It  is  intended  for  informaGon  purposes  only,  and  may  not  be  incorporated  into  any  contract.  It  is  not  a  commitment  to  deliver  any  material,  code,  or  funcGonality,  and  should  not  be  relied  upon  in  making  purchasing  decisions.  The  development,  release,  and  Gming  of  any  features  or  funcGonality  described  for  Oracle’s  products  remains  at  the  sole  discreGon  of  Oracle.  

Page 37: Burns jsf-confess-2015

Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    |