NLOUG - Tech Experience 2018
Java EE has become Jakarta EE under Eclipse Foundation.
This presentation shows the present and future and compares JSF 2.3+ with Oralce ADF 12cR2
1. Future of JSF / Oracle ADF
“Good bye J2EE?” No!, It is time for Jakarta EE!
Daniel Merchán García
2. Agenda
• Introduction
• J2EE? Time for Jakarta EE!
• Server Side vs Front Side
• Java Server Faces (JSF): Roadmap and JSF 2.3+
• Oracle Application Development Framework (ADF):
Roadmap
• Comparison: Oracle ADF 12cR2 (JSF 2.2) vs JSF 2.3
• Conclusion
• Contact Details
• Questions / Share your thoughts ☺
4. J2EE is now Jakarta EE
Oracle has given
Java EE to Eclipse
Foundation.
It is not EE4J (Eclipse
Enterprise for Java)
the name selected is
Jakarta EE.
The latest release of
J2EE under Oracle
was Java EE 8.
The migration to
Jakarta EE is still in
process.
javax.enterprise
packages will not be
re-factored to
eclipse.org
6. What we have right now in Java EE 8?
Java EE Security API – JSR
375
• Identity Store and
Authentication to
abstract vendor specific
security.
JSON-B / JSON-P / JAX-RS
(Enhancements)
• Enhance Java JSON API
support with Marshal /
Un-marshal JSON to
Java Objects as same as
JAX-WS does.
JPA 2.2
• Provides stream()
result support (similar
to Hibernate)
• @Repeatable
annotation to allow
using the same
annotation multiple
times in the same class.
• Alignment with Java
Date / Time
7. What we have right now in Java EE 8?
JSF 2.3
• Web Socket Support
• CDI Alignment
• JSF Manage Bean
Deprecation
• Validation / Conversion
Improvements
• UI Component / API
enhancements
• Alignment with Java 8 Date
/ Time new API
Servlet 4.0
• HTTP 2.0 Support
• Request / Response
multiplexing
• Stream prioritizing
• Server push.
CDI 2 and Bean Validation 2
• Big improvements in
@Observers and the
inclusion of Asynchronous
events.
• Alignment with Java 8 such
as streams, lambdas and the
new Date / Time API…
8. What’s coming
now with
Jakarta EE
Moving to Cloud-Native,
Microservices friendly Java
Enterprise.
• MicroProfile merge in Jakarta EE?
Deprecate old and un-used
technologies in Java EE to move
forward quickly.
Make the first Jakarta EE compatible
release with Java EE 8
Now the community decides.
Welcome back to Open Source! We do
not depend to any vendor anymore ☺
11. A typical conversation with a
Front-End evangelist
(me) “Hello friend!, I am using JSF 2.3 with PrimeFaces
for building my Enterprise Application! It looks great!”
(friend) No, wait!! That’s old, slow and not modern!
“Use Angular JS it is the best!” move on from Java!
(friend)(2 minutes later): “Angular JS now using
types??? It remembers me to Java. Don’t use it”
(friend)(2,1 minutes later) “Use React is the best!
Angular is shit”
(me) Ok… let me try Front-End. What automating
framework should I use? Grunt?
(friend) Why are you using Grunt? Use Gulp is the
best!!!...
(friend) (3 minutes later webpack is released): No
wait!… use webpack! Gulp is old!.
12. Server Side or Front-End Framework
Do not be seduced by trending’s.
“Old” technology frameworks are more mature and
stable.
Open your mind and become a Full-Stack developer.
Combine the force of Java and JavaScript!
15. What we have in JSF 2.3+?
• Following slides contains some of
the most important updates on
JSF 2.3 published in 2017.
• Some of them can be “work-
around in Oracle ADF” with some
coding.
• Some of them are really great
• Not all of news and updates are
covered!, but it will give a great
idea!.
16. JSF 2.3: CDI Bean Alignment
• @Inject your JSF Objects and avoid the
infinite code length typically produced in JSF.
Ready for CDI!.
• New EL Expressions to simplify the access to
JSF objects.
• New @ManagedProperty annotation CDI
Compatible for @Inject an EL Expression
• Deprecation of JSF Managed Beans.
Do not use javax.faces.beans anymore!
• For JSF specific scopes: FlowScope and
ViewScope use the CDI equivalents in
javax.faces.view
17. JSF 2.3: Lifecycle
• In JSF 2.0 <f:event> and JSF 2.2
<f:viewAction> (which allows to execute
only in Postback) were introduced.
Both have similar functionalities for
executing server code in a specific moment
of the new JSF Events introduced as part of
JSF 2.0
• In JSF 2.3 a new event has been added to
the lifecycle: PostRenderViewEvent to be
the opposite / friend of
PreRenderViewEvent
• We can use this event for executing code
after rendering the component without
penalizing the initial loading.
18. JSF 2.3: Networking
Web Socket
• Native support for WebSocket
• New tag <f:websocket> which creates a
communication channel
• Use PushContext object @Inject
@Push(name=“channelName”) for
pushing information to UI
19. JSF 2.3: AJAX
(h:commandScript)
• Encapsulate AJAX requests in JavaScript
functions placed in the Global Scope.
• Extends UICommand so it admits action,
actionListener, immediate, render,
execute…
20. JSF 2.3: API Enhancement
• UIData and UIRepeat allows now to also
now to iterate over java.util.Map.
• Custom types for UIRepeat / UIData can
be created by registering our own
@FacesDataModel
• Note: Built-in types cannot be
overridden!!!
21. JSF 2.3: Validation
• Bean Validation has its limitation in JSF 2.2.
Limited to validating individual properties
bound to individual components
• Bean validation also has a concept of class
level validation. This special validator can
then do cross-field validations. For
instance, check that values (different fields)
are equal.
• Class level validation does not play well
with the JSF validation model though. In
JSF the model is not updated if a validation
fails. But, a class level validation requires a
updated model!
• In JSF 2.3+ has been introduced
<f:validateWholeBean> to enable class
level validation and address this scenario.
25. JSF 2.3: Conversion
• JDK 8 Date Time API Support!. Now you can
use f:converDateTime with the new Java
API – JSR 310
• JSF 2.2/2.3: When the converter type
attribute value is {date, time, both} uses
the java.text.SimpleDateFormat class.
• Starting with JSF 2.3, when the converter
type attribute value is {localDate,
localTime, localDateTime, offsetTime,
offsetDateTime , zonedDateTime}, the
java.time.format.DateTimeFormatter class
will be used.
26. JSF 2.3: Components
Component Search FMW
• Identifying a particular component
in its component tree by using an
absolute hierarchical ID, or a
relative local ID. Constructing the
absolute ID is not always easy,
especially not if a page makes
extensive use of templates and
includes.
• In JSF 2.3+ has been introduced a
Component Search Framework
27. JSF 2.3: Components
Component Search FMW
• This table displays the keywords
that can be used to easily search
for a component in the JSF Tree.
Keyword Description
@child(n) The nth child of the base component
@composite
The closest composite component ancestor of the base
component
@id(id)
All component descendants of the base component
with the specified component id
@namingcontainer
The closest NamingContainer ancestor of the base
component
@next
The next component in the view after the base
component
@parent The parent of the base component
@previous The previous component to the base component
@root The UIViewRoot
33. Oracle ADF - Now and Future
Oracle ADF is based on JavaServer Faces. You love it or hate it. There is not middle
point. ☺
Oracle ADF 12.2.1.3 (latest release) is based on JSF 2.2.
There are not plans for upgrading Oracle ADF to be aligned with JSF 2.3+ and beyond.
Oracle ADF is still supported by Oracle, but it will not receive major improvements or
upgrades.
34. Should I still use
Oracle ADF?
Yes…, but….
• Oracle ADF Business Components are
a great option for building business
services and expose as REST.
• Oracle JET does not replace Oracle
ADF <- They are different!
• Stable and mature.
• Excellent for Java background
developers for building internal
Enterprise Applications.
Yes:
• No plans for improving / enhancing
the framework. Only bug fixing.
• ADF Faces is not evolving as other JSF
implementations such as PrimeFaces.
• Oracle ADF developers are becoming
the new “COBOL” developers. The
community is decreasing compared
to Oracle JET or other Front-End
framework technologies.
But:
35. Oracle ADF 12cR2 (JSF 2.2) vs JSF 2.3+
Equivalent or how to use “JSF2.3” in ADF 12cR2 (JSF2.2)
36. Can I use CDI Manage
Beans in Oracle ADF?
• Oracle WebLogic 12cR2+ is compatible
with CDI Managed Beans.
• You can enable CDI in your Oracle ADF
Projects if you are using Java EE6+
• When trying to use CDI annotations,
JDeveloper will suggest to configure CDI
support and creates beans.xml for you
38. Should I only use CDI in
Oracle ADF as JSF
Managed Beans are
deprecated in 2.3?
• My suggestion is: NO! Oracle does
not has plan to move into JSF 2.3
• Injecting CDI in JSF and vice-versa
requires some extra coding. It does not
work using annotations.
• JDeveloper IDE suggestions / code
assistant sometimes does not work
properly with CDI Managed Beans.
• JSF 2.2 is not fully ready for inject CDI in
Validator / Converter and other JSF
Artefacts.
• JSF 2.3 CDI compatible scope called
FlowScope is not equivalent to
PageFlowScope in Oracle ADF.
39. Web Socket
Endpoint
Server Listener
ADF Application
Web Socket
Client
Using Web Sockets in
Oracle ADF
• Oracle ADF does not provide
<f:websocket>. But Web
Sockets can be used anyway in
a non-declarative way.
• Create your Web Socket
Endpoint (Server Side)
• Connect from your ADF
Application to listen messages
pushed from the Server.
46. Summary
Coding in Oracle ADF maybe
feels “retro”
Oracle ADF is still a very
valid option for developing
Enterprise Applications.
JSF 2.3 introduced many
improvements, but the most
of them they have a code
driven alternative in Oracle
ADF as shown in this
presentation.
Oracle should align ADF with
new J2SE API Standards such
as the new Date / Time API.
THINK TWICE before
choosing Oracle ADF over
Oracle JET for your project.