what's cool in apache myfaces?
DESCRIPTION
TRANSCRIPT
1
2
What's cool in Apache MyFacesMatthias Wessendorf (Oracle) | Principal Member Technical StaffAli Ok (Innflow AG) | Java Developer
3
Ali Ok
Innflow AG MyFaces committer
– Google Summer of Code (HTML5) PrimeFaces Twitter : @aliok_tr Blog : blog.aliok.com.tr
4
Matthias Wessendorf Oracle Apache Software Foundation
– Member– Committer and PMC MyFaces
Author Conference Speaker Twitter : @mwessendorf Blog : matthiaswessendorf.wordpress.com
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)
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)
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
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)*
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
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)
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
12
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
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)
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
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
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)
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“
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 ???
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 **
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
22
Getting REAL
23
Getting REAL
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)
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
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
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, ...
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
29
Component Design
• Input components:– Client side validation, driven by JSF validators!
• Html5 Behaviors:– Implemented as JSF behaviors
• Works in Mojarra, using MyFaces shared
30
DEMO: MyFaces Html5 Component Libraryhttp://bit.ly/myfaces-html5-j1-demo
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
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)
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!
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 ;-)
35
BLOG APPLICATION DEMO
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)
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
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
39
MyFaces ExtVal - Code
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
41
MyFaces CODI
Code and Demo
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)
43
Questions ? ANSWERS!
44
WANTED:
NEW CONTRIBUTORS !
http://myfaces.apache.org
Get started today!