what's cool in apache myfaces?

44
1

Upload: aliok

Post on 31-Oct-2014

19 views

Category:

Documents


1 download

DESCRIPTION

 

TRANSCRIPT

Page 1: What's cool in Apache MyFaces?

1

Page 2: What's cool in Apache MyFaces?

2

What's cool in Apache MyFacesMatthias Wessendorf (Oracle) | Principal Member Technical StaffAli Ok (Innflow AG) | Java Developer

Page 3: What's cool in Apache MyFaces?

3

Ali Ok

Innflow AG MyFaces committer

– Google Summer of Code (HTML5) PrimeFaces Twitter : @aliok_tr Blog : blog.aliok.com.tr

Page 4: What's cool in Apache MyFaces?

4

Matthias Wessendorf Oracle Apache Software Foundation

– Member– Committer and PMC MyFaces

Author Conference Speaker Twitter : @mwessendorf Blog : matthiaswessendorf.wordpress.com

Page 5: What's cool in Apache MyFaces?

5

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 6: What's cool in Apache MyFaces?

6

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 7: What's cool in Apache MyFaces?

7

Planet Apache MyFaces Commiters: 67 (soon we have more! No kidding!) First! OpenSource JSF Implementation Offers different JSF implementations

– JSF 1.1 (Maintenance Mode) Last release (1.1.8): June 10, 2010

– JSF 1.2 (Maintenance Mode) Last release (1.2.9): June 10, 2010

– JSF 2.0 (trunk and main focus) Current release 2.0.1: July 18, 2010

Page 8: What's cool in Apache MyFaces?

8

Planet Apache MyFaces Since 2004 an Apache project

– 2002 -> 2004 on sourceforge (LGPL) Biggest JSF (user) community

– Apache: Community over Code!– A good community builds good code– Interested? Join us!!! :)

More than „just“ an implementation

Innovation happens at Apache (MyFaces)*

Page 9: What's cool in Apache MyFaces?

9

Planet Apache MyFaces Core: The JSF implementation Tomahawk: a "classic" component library Tobago: Component library with layout focus Trinidad: Framework and component library Commons: Goodies and non-renderkit tools (async-

lifecycle,user-agent,validators, converters...) Extensions: CDI, Validator and Scripting/Groovy Orchestra: conversation (aka dialog) scope for beans Portlet-Brigde: RI + TCK* for JSF/Portlet stuff (301/329) Test: Shale Test continues here! Maven: Several Plugins to generate JSF artifacts GSOC: "root" folder for all (new) GSOC activities

Page 10: What's cool in Apache MyFaces?

10

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summary (and Q/A)

Page 11: What's cool in Apache MyFaces?

11

Apache MyFaces 2.x 2.0.1 had a ton of improvements

– still working on improving MyFaces (PERF,...) working on being greatly productive...

Improvements for JavaServer Faces 2.1/ 2.2– MyFaces community had donations to the EG:

• ajax uploads• Fix UIData state saving (spec issue 153)

https://issues.apache.org/jira/browse/MYFACES-2616

Page 12: What's cool in Apache MyFaces?

12

Page 13: What's cool in Apache MyFaces?

13

Apache MyFaces 2.x 2.0.1 had a ton of improvements

– still working on improving MyFaces (PERF,...) working on being greatly productive...

Improvements for JavaServer Faces 2.1 / 2.2– MyFaces community had donations to the EG:

• ajax uploads• Fix UIData state saving (spec issue 153)

https://issues.apache.org/jira/browse/MYFACES-2616

Page 14: What's cool in Apache MyFaces?

14

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 15: What's cool in Apache MyFaces?

15

MyFaces goes App Engine What is Google App Engine?

– Running web applications on G’s– Java (JVM based languages) and Python– Satisfactory quotas for free accounts

• 1.3 M daily requests• 1 GB datastore (Bigtable / NoSql)• 500 MB webspace

Page 16: What's cool in Apache MyFaces?

16

Some limitations... Blacklisted classes:

– MyFaces will initiate without using them, some limitations occur

"Reload"s and "unload"s:• State: MyFaces initializes on each "reload", no

effects other than some loading time (5 secs)• Not persisting application scope across "reload"s• Session is persisted across requests (via datastore)

though:– Rule : need to implement session scoped

managed beans as serializable

Page 17: What's cool in Apache MyFaces?

17

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 18: What's cool in Apache MyFaces?

18

Trinidad goes mobile The mobile Web is back. It is REAL

– Poweful Phones, like Android or iPhone Still Challenges:

– Wide variety of browser capabilities• JavaScript and Ajax• CSS / DOM

– Uneven device performance• iPhone/BlackBerry Bold/other smartphones• Consumer phones

– Different device interfaces and user interactions• Touch screen VS non-touch screen• Finger navigation VS „keyboard“

Page 19: What's cool in Apache MyFaces?

19

Compelling Mobile Web Applications (device) native Look-and-feel

– similar user experiences between mobile web application and native mobile application

Performs well across various device types and connectivity– Leverage advanced AJAX capabilities in

smartphone browsers to reduce network traffic– Reduce or eliminate JavaScript and Style sheets for

less capable mobile devices with limited bandwidth Several (mobile) versions ???

Page 20: What's cool in Apache MyFaces?

20

Compelling Mobile Applications with JSF/Trinidad

Device-native application look-and-feel– Skinning: applications can be skinned to achieve device

native LAF** Two levels of rendering support:

– Trinidad render kit renders UI component based on browser capabilities

– Platform specific style sheets controlled by the developer **

Page 21: What's cool in Apache MyFaces?

21

Compelling Mobile Applications with JSF/Trinidad

Performs well across various device types and connectivity– AJAX Support reduces data and network round trips for

smartphone browsers– Trinidad components automatically switch to plain HTML

when targeting basic mobile devices• Better performance for devices with less powerful

processors

Page 22: What's cool in Apache MyFaces?

22

Getting REAL

Page 23: What's cool in Apache MyFaces?

23

Getting REAL

Page 24: What's cool in Apache MyFaces?

24

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 25: What's cool in Apache MyFaces?

25

Google Summer of Code Apache: Community over Code

– Codeawards are a great fit! Apache (MyFaces) started in 2005*

– Getting new committers In 2010 we have four projects

– HTML5– MyFaces Application Builder– Performance improvements– Automated Testing Module

Page 26: What's cool in Apache MyFaces?

26

MyFaces meets HTML5

• Google Summer of Code project– New Html5 Renderkit, focusing on popular new

elements and some of new functionality like Drag and Drop

• Getting ready for next generation web applications– Next versions of JSF

• Compatibility problems between JSF and Html5• Making use of new APIs

– JSF 2.Next :• Supporting Html5 features in standard JSF components

Page 27: What's cool in Apache MyFaces?

27

MyFaces meets Html5• What is cool in Html5?• APIs:

– Websockets, File API, Desktop notifications, XHR Level 2, better error handling, ...

• Html:– New input types, client-side validation, native

DnD, semantics, new elements, ...• CSS:

– New selectors, effects, transforms, ...

Page 28: What's cool in Apache MyFaces?

28

Html5 Spec Design

• Backwards compatible– New elements designed with an approach to

make old browsers just ignore them• Fixing lack of error handling• Reducing the necessity of external plugins• More semantic stuff

Page 29: What's cool in Apache MyFaces?

29

Component Design

• Input components:– Client side validation, driven by JSF validators!

• Html5 Behaviors:– Implemented as JSF behaviors

• Works in Mojarra, using MyFaces shared

Page 30: What's cool in Apache MyFaces?

30

DEMO: MyFaces Html5 Component Libraryhttp://bit.ly/myfaces-html5-j1-demo

Page 31: What's cool in Apache MyFaces?

31

Roadmap• “Ajax” file upload, uploading multiple files, file

upload area(drop zone) with XHR 2• Making use of new Html elements• Support for applicable Html5 features in core

components• Websockets, Notifications, ... support• Form independence of input components• Fallbacks for older browsers and Html5 detection

Page 32: What's cool in Apache MyFaces?

32

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 33: What's cool in Apache MyFaces?

33

Enterprise Java integration JavaServer Faces is view-tier Different „backend“ technologies are used

– Most common• Java EE• Spring Framework

Java is not the only language for the JVM– Scala– Groovy

Apache MyFaces helps to integrate them!

Page 34: What's cool in Apache MyFaces?

34

Groovy/Scripting Module Groovy: dynamic language for the JVM

– JSR 241 (unfinished / inactive) Similar to Java and easy to learn MyFaces Scripting

– Groovy; other languages may follow...– STATUS: Beta, playing never hurts ;-)– Write JSF pieces in Groovy and script them!

• NOT ONLY managed beans ;-)

Page 35: What's cool in Apache MyFaces?

35

BLOG APPLICATION DEMO

Page 36: What's cool in Apache MyFaces?

36

Orchestra: Spring Support JSF Extension Library Conversation Scope (for multi request)

– for managed beans (spring or @nnotations) Persistence Context Handling

– ConversationScope & PersistenceContext– no more LazyInitializationExceptions

ViewController– callbacks (initView(), preProcess(), preRenderView())

Declarative Transactions– Via @annotations (JDK 1.5 or later)

Page 37: What's cool in Apache MyFaces?

37

Java EE Java EE 6 is a modern and lightweight platform MyFaces offers first class support for

– Bean Validation (JSR 303)• MyFaces ExtVal (303 and more!)

– Contexts and Dependency Injection for the Java EE platform (JSR 299)

– MyFaces CODI (brand new!)• JSE Module

– i18n support with fluent API• JEE Module

Page 38: What's cool in Apache MyFaces?

38

MyFaces ExtVal Validation Framework (for JSF) Leverages JPA @nnotations! (JSR backed)

– Seam is using Hibernate Validation Cross-component validation Client-Side Validation (not easy with JSF default)

– only for Trinidad– tbc...

Custom Validators:– Create your own @ValidateMeOnlyOnMonday

JSR 303 (Bean Validation) integration

Page 39: What's cool in Apache MyFaces?

39

MyFaces ExtVal - Code

Page 40: What's cool in Apache MyFaces?

40

MyFaces CODI Java EE Module

– BeanValidation support– JSF2 support– JSF1.2 support: Bring CDI to JSF 1.2

Offering „Orchestra feature“ for CDI– @ConversationScoped– @ViewAccessScoped

And more CDI-based Scopes– @WindowScoped– Supporting JSF's @ViewScoped via CDI

Page 41: What's cool in Apache MyFaces?

41

MyFaces CODI

Code and Demo

Page 42: What's cool in Apache MyFaces?

42

Agenda Planet Apache MyFaces Core: Apache MyFaces 2.x Google App Engine Trinidad and the mobile Web The ASF and Google Summer of Code

– Overview MyFaces activities– MyFaces meets HTML5

Apache MyFaces and the 'Java Enterprise' ecosystem– Spring– Java EE– Groovy

Summery (and Q/A)

Page 43: What's cool in Apache MyFaces?

43

Questions ? ANSWERS!

Page 44: What's cool in Apache MyFaces?

44

WANTED:

NEW CONTRIBUTORS !

http://myfaces.apache.org

Get started today!