SlideShare una empresa de Scribd logo
1 de 67
Descargar para leer sin conexión
JAVA EE 7
FROM AN HTML5 PERSPECTIVE
Ed Burns @edburns and Oliver Szymanski @source_knights
2
Safe Harbor Statement
The following is intended to outline our general product direction. It is
intended for information purposes only, and may not be incorporated
into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing
decisions. The development, release, and timing of any features or
functionality described for Oracle’s products remains at the sole
discretion of Oracle.
Copyright 2015 Ed Burns and Oliver Szymanski
Speaker Qualifications – Ed Burns
Copyright 2015 Ed Burns and Oliver Szymanski
3
¨  Involved with JSF since 2002
¨  JSF Spec lead since 2003
¤  Most fun part of the job: cleanly integrating other
people’s great ideas into JSF (and hopefully improving
on the in the process)
¤  Not an expert in applying JSF in practice
¨  Servlet Spec lead since 2014
Speaker Qualifications – Ed Burns
Copyright 2015 Ed Burns and Oliver Szymanski
4
¨  Author of four books for McGraw-Hill
Speaker Qualifications – Oliver Szymanski
Copyright 2015 Ed Burns and Oliver Szymanski
5
¨  Independent Java Enterprise Consultant
¨  Specialty in the Financial Sector
¨  JUG Founder Erlangen/Nuremberg Germany
Speaker Qualifications – Oliver Szymanski
Copyright 2015 Ed Burns and Oliver Szymanski
6
¨  Contributing author for
¤  Heise Developer Channel
¤  S&S Entwickler
¤  Java aktuell
¤  Java Magazin
Meet the Family
Copyright 2015 Ed Burns and Oliver Szymanski
7
Meet the Family
¨  Java API for JSON
Processing
¨  Java API for
WebSocket
¨  Batch Application
¨  Concurrency Utilities
¨  Caching
¨  Java Persistence
Architecture
¨  …
¨  Java API for REST
¨  JavaServer Faces
¨  Servlets
¨  Expression Language
¨  Java Messaging
Service
¨  Contexts and
Dependency Injection
¨  Java Transaction
Architecture
8
Copyright 2015 Ed Burns and Oliver Szymanski
Meet the HTML5-Friendly Family
¨  Java API for JSON
Processing
¨  Java API for
WebSocket
¨  Batch Application
¨  Concurrency Utilities
¨  Caching
¨  Java Persistence
Architecture
¨  …
¨  Java API for REST
¨  JavaServer Faces
¨  Servlets
¨  Expression Language
¨  Java Messaging
Service
¨  Contexts and
Dependency Injection
¨  Java Transaction
Architecture
9
Copyright 2015 Ed Burns and Oliver Szymanski
HTML5Why all the fuss?
More cute logos at
http://www.w3.org/html/logo/
HTML5Why all the fuss?
PAST AND PRESENT
SERVER
Classification
¨  Why?
¤  Multiple Computers
¤  Interconnections Between Them
¤  Shared State Among Them
¨  Today's production Web apps are extremely
complex distributed applications.
A Web App is a Distributed App
Yeah, So What?
¨  Why does this classification matter?
¤  Because History Matters
¨  To understand the current state of web applications,
we must go back to the history of distributed
applications, and of the Internet itself.
HTML5
¨  Remember all the fuss about Ajax in 2006?
¤  Asynchronous
¤  JavaScript
¤  And
¤  XMLHttpRequest
What’s in a name?
HTML5
¨  Remember all the fuss about Ajax in 2006?
¤  Asynchronous
¤  JavaScript
¤  And
¤  XMLHttpRequest
¨  Ajax is a programming technique, not a single
technology
What’s in a name?
HTML4
¨  What do people mean when they say HTML4?
¤  IE6
¤  Not very high performance JavaScript
¤  Lots of browser tricks
¤  Use of native plugins is common
¨  HTML4 is seen as a single technology
What’s in a name?
HTML5
¨  What do people mean when they
say HTML5?
¤  “Modern” browsers
¤  A gigantic collection of related
technologies
n  Markup
n  Offline storage
n  EventSource
n  DOM
n  JavaScript
n  CSS3
What’s in a name?
n  Canvas
n  Input controls
n  Web components
n  Application Cache
n  WebSocket
n  JSON
n  Geolocation
n  XMLHttpRequest
Level 2
HTML5
¨  The rise of Chrome and the end of polyfill
¨  Standards have finally won
¤  How good is your standards body?
n  W3C, ECMA, IETF
¤  HTML5: Microsoft, Google, Apple, what about Mozilla?
¨  Aside:
¤  Is HTML5 a bloated specification?
¤  Is JavaEE a bloated specification?
¤  What is bloat? A indicator of how old something is.
¤  http://mir.aculo.us/2010/10/19/standards-bloat-and-
html5/
Is it really a big deal?
HTML5
¨  The death of the browser plugin: April 2010
http://www.apple.com/hotnews/thoughts-on-flash/
¨  Where does the tension remain?
¤  Take advantage of the power in the client
¤  Minimize the complexity of distributing and maintaining
the software
Is it really a big deal?
HTML5
¨  HTML5 is a marketing term that describes a way of
building the UI for a distributed system.
¤  UI processing task resides entirely in the browser
Putting it in context
What Makes a Distributed App
¨  Finding the best allocation of processing tasks to
processing nodes
¤  User Interface
¤  Domain Logic
¤  Application Logic
¤  Data Persistence
¤  Communication
¤  Reliability, Security
What Makes a Distributed App
¨  Finding the best allocation of processing tasks to
processing nodes
¤  User Interface
¤  Domain Logic
¤  Application Logic
¤  Data Persistence
¤  Communication
¤  Reliability, Security
UI Considerations
¨  The UI is the hardest part to get right
¨  The technology for building the UI is changing very
rapidly, and will continue to change for the
forseeable future
¨  The technology for the other aspects of application
development is less volatile, more mature.
¨  The major software stack and device vendors are
competing on the basis of their UI technology, as the
gateway to the rest of their stack
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>!
!
HTML5 Friendly Markup
¨  JSF Views are written in a View Declaration
Language (VDL).
¨  The standard Facelet VDL is an XML application with
two kinds of elements
¤  HTML Markup
¤  JSF Components
¨  HTML Markup is passed through straight to the
browser
¨  JSF Components take some action on the server,
during the lifecycle`
Let’s get back to basics
HTML5 Friendly Markup
¨  Before JSF 2.2
¤  JSF tags hide complexity of underlying HTML+script+css
+images
¤  JSF “Renderer”:
n  encode: markup to browser
n  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
HTML5 Friendly Markup
¨  With JSF 2.2
¤  Pure HTML+script+css+images in the JSF page
¤  JSF Renderer handles decode from browser
n  Leverage the strength of the JSF lifecycle
n  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
JSR 341 Expression Language 3.0
¨  First introduced in JSTL 1.0 in 2004
¨  Moved to JSP 2.0 in 2006
¨  Unified with JSF 1.2 in JSP 2.1 in 2006
¨  JSR 341: first independent specification in 2013
¨  Used in JSF, JSP and CDI
¨  Key differentiator between JavaServer and non-
JavaServer stacks
Overview
JSR 341 Expression Language 3.0
¨  Lambda expressions
¨  Support for stand-alone environments
¨  New operators
¨  Static field and method reference
¨  Custom type converter
¨  Collection construction
¨  Collection operations
New Feature Summary
JSR 341 Expression Language 3.0
¨  Same syntax as JavaSE 8, but available in EE 7
¨  Behaves like an anonymous function
¨  Body consist of an EL expression
¨  Full access to EL environment in the body
Lambda expression
x -> x+1!
(x,y) -> x+y!
() -> 64!
JSR 341 Expression Language 3.0
¨  The lambda is evaluated and discarded
Lambda expression: immediate evaluation
(x -> x+1)(10)! !à 11!
((x,y)->x+y)(3,4) !à 7!
(()->64)() ! !à 64!
JSR 341 Expression Language 3.0
¨  JSF Facelet page
<h:dataTable rendered=!“#{user.loggedIn}”

value="#{library.books.stream().

filter(b->b.category == 'Comedy').

map(b->b.title).toList()}" var="book">!
<h:column>#{book.title}</h:column>!
</h:dataTable>!
Collection operations: examples
What Makes a Distributed App
¨  Finding the best allocation of processing tasks to
processing nodes
¤  User Interface
¤  Domain Logic
¤  Application Logic
¤  Data Persistence
¤  Communication
¤  Reliability, Security
Java API for JSON Processing 1.0
¨  API to parse and generate JSON
¨  Streaming API
¤  Low-level, efficient way to parse/generate JSON
¤  Provides pluggability for parsers/generators
¨  Object Model
¤  Simple, easy-to-use high-level API
¤  Implemented on top of Streaming API
¨  Binding JSON to Java objects forthcoming
Overview – JSR 353
Java API for JSON Processing 1.0
¨  Parses JSON in a streaming way from input sources
¤  Similar to StaX’s XMLStreamReader, a pull parser
¨  Created using
¤  Json.createParser(…)!
¤  Json.createParserFactory().createParser(
…)!
¨  Parser state events
¤  START_ARRAY, END_ARRAY, START_OBJECT,
END_OBJECT, …
Streaming API
Java API for JSON Processing 1.0
¨  JsonObject/JsonArray – JSON object and
array structures
¤  JsonString and JsonNumber for string and
number values
¨  JsonBuilder – Builds JsonObject and JsonArray
¨  JsonReader – Reads JsonObject and JsonArray
from input source
¨  JsonWriter – Writes JsonObject and JsonArray
to output source
Object Model API
Java API for RESTful Web Services
2.0
¨  Client API
¨  Message Filters & Entity Interceptors
¨  Asynchronous Processing – Server & Client
¨  Hypermedia Support
¨  Common Configuration
Overview – JSR 339
Java API for RESTful Web Services
2.0
Server-side Async
@Path("/async/longRunning")!
public class MyResource { !
!
@GET!
public void longRunningOp(@Suspended AsyncResponse ar) {!
!
ar.setTimeoutHandler(new MyTimoutHandler());!
ar.setTimeout(15, SECONDS);!
!
Executors.newSingleThreadExecutor().submit(new Runnable() {!
public void run() { !
…!
ar.resume(result);!
}!
});!
}!
}!
Java API for RESTful Web Services
2.0
Server-side Content Negotiation
@Path("/")

class ProductResource {!
    @GET

    @Produces({"text/xml;qs=0.75", "application/json"})

    public Product[] getProducts() {

        . . .

    }

}!
Java Message Service 2.0
¨  Less verbose
¨  Reduce boilerplate code
¨  Resource injection
¨  Connection, Session, and other objects are
AutoCloseable
¨  Requires Resource Adapter for Java EE containers
¨  Simplified API in both Java SE and EE
Overview – JSR 343
Java Message Service 2.0
¨  Make JMS objects implement AutoCloseable!
¤  Connection !
¤  Session !
¤  MessageProducer !
¤  MessageConsumer !
¤  QueueBrowser!
¨  Requires Java SE 7
Auto close resources
@Resource(lookup = "jms/connFactory")

ConnectionFactory cf; !
@Resource(lookup="jms/inboundQueue")!
Destination dest;!
!
public void sendMessage (String payload) throws JMSException {!
try ( Connection conn = connectionFactory.createConnection(); !
Session session = conn.createSession();!
MessageProducer producer = session.createProducer(dest);!
){ !
Message mess = sess.createTextMessage(payload); !
producer.send(mess); !
} catch(JMSException e){ !
// exception handling !
}

}!
Create closeable
resources in a try-
with-resources block
close() is called
automatically
at end of block
Java Message Service 2.0
Auto close resources
@Resource(lookup = "java:global/jms/demoConnectionFactory")!
ConnectionFactory connectionFactory; !
!
@Resource(lookup = "java:global/jms/demoQueue")!
Queue demoQueue;!
!
public void sendMessage (String payload) {!
try (JMSContext context = connectionFactory.createContext();){!
context.createProducer().send(demoQueue, payload);!
} catch (JMSRuntimeException ex) {!
// exception handling!
}!
}!
close() is called
automatically
at end of block
JMSContext
combines
Connection
and Session
Payload
can be sent
directly
No checked
exceptions
thrown
Java Message Service 2.0
Introducing JMSContext
@Inject

JMSContext context;!
!
@Resource(lookup = "java:global/jms/demoQueue”)

Queue demoQueue;!
!
public void sendMessage(String payload) {!
context.createProducer().send(demoQueue, payload);!
}!
Default resource definition
Or
@JmsConnectionFactory!
13 lines è1 line!
Java Message Service 2.0
Default Data Source Definition
What Makes a Distributed App
¨  Finding the best allocation of processing tasks to
processing nodes
¤  User Interface
¤  Domain Logic
¤  Application Logic
¤  Data Persistence
¤  Communication
¤  Reliability, Security
WebSockets
¨  Several moving parts, each with its own standard!
¤  Client: W3C JavaScript API http://dev.w3.org/html5/
websockets/
¤  Transport: IETF RFC 6455 http://www.ietf.org/rfc/
rfc6455.txt
¤  Server: JSR-356: http://jcp.org/en/jsr/detail?id=356
¨  Even with all these parts, it’s still very
understandable
¤  Client: 17 page downs
¤  Transport: 86 page downs (about a third of which you
can skip)
What’s In a name?
WebSockets
WebSocket
¨  It really is a Socket for the Web
¤  It just works over proxies
¨  Lets you do TCP easily in a web app
¤  Establish the connection
¤  Send messages both ways
¤  Send messages independent of timing
¤  Close the connection
¨  Two basic types: text and binary
Big Picture
WebSocketEstablish the connection
WebSocketTCP over HTTP, use the Upgrade: header
WebSocketTCP over HTTP, use the Upgrade: header
WebSocketTCP over HTTP, use the Upgrade: header
WebSocketBrowser Support – caniuse.com
JavaScript/Browser Client
¨  Minimal Lifecycle
¤  new WebSocket(url)!
¤  pass in some functions
n  onopen!
n  onmessage!
¤  call send()!
¤  call close() !
¨  Can connect to arbitrary servers, other than the
page origin
¨  Server may enforce use of Origin header
JavaScript WebSocket Object
JavaScript/Browser ClientJavaScript WebSocket Object
¨  [Clamp] if
value is out of
range,
truncate it to
closest in-
range value
for that
primitive type.
Java Server
¨  Minimal Lifecycle
¤  Handshake
¤  Messaging
¤  Close
¨  All methods that deal with communication to the
other endpoint are passed a
javax.websocket.Session.
¨  Has nothing to do with
javax.servlet.http.HttpSession.
¨  HttpSession can be obtained from
Java Endpoint
Java Server
¨  Passing Parameters
¨  example URI “/bookings/JohnSmith”: guestID is
“JohnSmith”
¨  Strings and primitives supported
Java Endpoint
Java Server
Two Styles
¨  Annotated
¤  The most commonly used
¤  Very easy to get started
¤  Throw it in the WAR and you’re done
¨  Programmatic
¤  If you don’t want to bake config into your .class files
¤  Must use Java inheritance
Java Endpoint
Java Server
¨  Must bootstrap via ServletContextListener!
¤  Look up the
javax.websocket.server.ServerContaine
r attribute
¤  It will be an instance of
javax.websocket.server.ServerContaine
r!
¤  Call addEndpoint(), two variants
n  takes a class that is the annotated endpoint class
n  takes a ServerEndpointConfig instance
Programmatic Endpoint
Java ServerAnnotated Endpoint
Java ServerAnnotated Endpoint
Java Server
¨  The ServerEndpointConfig instance
¤  getEndpointClass() returns
n  annotated endpoint
n  class that extends javax.websocket.Endpoint!
¤  getPath() returns the path, may contain url-
template content
Programmatic Endpoint
WebSocket
¨  Send or receive text or binary messages
¤  As complete messages
¤  As sequence of partial messages
¤  Using traditional blocking I/O
¨  Send or receive WebSocket messages as pure Java
Objects (kinda like Serialization)
¤  Using encode/decode mechanism
¤  Encoder/decoder for all primitive types built in
¨  Send and receive messages synchronously or
asynchronously
Flexible Message Processing
66
Safe Harbor Statement
The preceding was intended to outline our general product direction. It
was intended for information purposes only, and may not be
incorporated into any contract. It was not a commitment to deliver any
material, code, or functionality, and should not be relied upon in
making purchasing decisions. The development, release, and timing of
any features or functionality described for Oracle’s products remains
at the sole discretion of Oracle.
Copyright 2015 Ed Burns and Oliver Szymanski
Thank you67
Copyright 2015 Ed Burns and Oliver Szymanski

Más contenido relacionado

La actualidad más candente

Seven Points for Applying Java EE 7
Seven Points for Applying Java EE 7Seven Points for Applying Java EE 7
Seven Points for Applying Java EE 7
Hirofumi Iwasaki
 
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
Ed presents JSF 2.2 at a 2013 Gameduell Tech talkEd presents JSF 2.2 at a 2013 Gameduell Tech talk
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
Edward Burns
 

La actualidad más candente (19)

Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374Adopt-a-JSR for JSON Processing 1.1, JSR 374
Adopt-a-JSR for JSON Processing 1.1, JSR 374
 
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFishBatch Applications for Java Platform 1.0: Java EE 7 and GlassFish
Batch Applications for Java Platform 1.0: Java EE 7 and GlassFish
 
Seven Points for Applying Java EE 7
Seven Points for Applying Java EE 7Seven Points for Applying Java EE 7
Seven Points for Applying Java EE 7
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 
CON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To YouCON5898 What Servlet 4.0 Means To You
CON5898 What Servlet 4.0 Means To You
 
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
Ed presents JSF 2.2 at a 2013 Gameduell Tech talkEd presents JSF 2.2 at a 2013 Gameduell Tech talk
Ed presents JSF 2.2 at a 2013 Gameduell Tech talk
 
Move from J2EE to Java EE
Move from J2EE to Java EEMove from J2EE to Java EE
Move from J2EE to Java EE
 
JavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great MatchJavaScript Frameworks and Java EE – A Great Match
JavaScript Frameworks and Java EE – A Great Match
 
What's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and BeyondWhat's New in WebLogic 12.1.3 and Beyond
What's New in WebLogic 12.1.3 and Beyond
 
Down-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EEDown-to-Earth Microservices with Java EE
Down-to-Earth Microservices with Java EE
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
 
Have You Seen Java EE Lately?
Have You Seen Java EE Lately?Have You Seen Java EE Lately?
Have You Seen Java EE Lately?
 
Java API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFishJava API for WebSocket 1.0: Java EE 7 and GlassFish
Java API for WebSocket 1.0: Java EE 7 and GlassFish
 
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial SystemsJava EE 6 Adoption in One of the World’s Largest Online Financial Systems
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems
 
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFacesJavaOne - 10 Tips for Java EE 7 with PrimeFaces
JavaOne - 10 Tips for Java EE 7 with PrimeFaces
 

Destacado

Destacado (16)

Java7 New Features and Code Examples
Java7 New Features and Code ExamplesJava7 New Features and Code Examples
Java7 New Features and Code Examples
 
Jersey Coders New Term Introduction
Jersey Coders New Term IntroductionJersey Coders New Term Introduction
Jersey Coders New Term Introduction
 
Java EE revisits design patterns
Java EE revisits design patternsJava EE revisits design patterns
Java EE revisits design patterns
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
 
SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016SE2016 - Java EE revisits design patterns 2016
SE2016 - Java EE revisits design patterns 2016
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
楽天トラベルとSpring(Spring Day 2016)
楽天トラベルとSpring(Spring Day 2016)楽天トラベルとSpring(Spring Day 2016)
楽天トラベルとSpring(Spring Day 2016)
 
Spring Day 2016 springの現在過去未来
Spring Day 2016 springの現在過去未来Spring Day 2016 springの現在過去未来
Spring Day 2016 springの現在過去未来
 
Lineにおけるspring frameworkの活用
Lineにおけるspring frameworkの活用Lineにおけるspring frameworkの活用
Lineにおけるspring frameworkの活用
 
Spring bootで学ぶ初めてのwebアプリ開発
Spring bootで学ぶ初めてのwebアプリ開発Spring bootで学ぶ初めてのwebアプリ開発
Spring bootで学ぶ初めてのwebアプリ開発
 
アメブロの大規模システム刷新と それを支えるSpring
アメブロの大規模システム刷新と それを支えるSpringアメブロの大規模システム刷新と それを支えるSpring
アメブロの大規模システム刷新と それを支えるSpring
 
Spring Day 2016 - Web API アクセス制御の最適解
Spring Day 2016 - Web API アクセス制御の最適解Spring Day 2016 - Web API アクセス制御の最適解
Spring Day 2016 - Web API アクセス制御の最適解
 
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...Data Microservices with Spring Cloud Stream, Task,  and Data Flow #jsug #spri...
Data Microservices with Spring Cloud Stream, Task, and Data Flow #jsug #spri...
 
Java EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 MeanJava EE 8: What Servlet 4 and HTTP2 Mean
Java EE 8: What Servlet 4 and HTTP2 Mean
 
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to youJava EE 8: What Servlet 4.0 and HTTP/2 mean to you
Java EE 8: What Servlet 4.0 and HTTP/2 mean to you
 
Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門Spring 5に備えるリアクティブプログラミング入門
Spring 5に備えるリアクティブプログラミング入門
 

Similar a Java EE 7 from an HTML5 Perspective, JavaLand 2015

Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Chris Love
 
Terry's Resume 3.1
Terry's Resume 3.1Terry's Resume 3.1
Terry's Resume 3.1
terry meng
 
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Expbakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
Bakkesh K S
 
Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)
Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)
Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)
Nishant Verma
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master Class
Spike Brehm
 
JavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin GermanJavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin German
Adam Boczek
 

Similar a Java EE 7 from an HTML5 Perspective, JavaLand 2015 (20)

Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | Introduction
 
Web Development for UX Designers
Web Development for UX DesignersWeb Development for UX Designers
Web Development for UX Designers
 
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code CampDoing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
Doing Modern Web, aka JavaScript and HTML5 in the Enterprise NYC Code Camp
 
The State of Wicket
The State of WicketThe State of Wicket
The State of Wicket
 
Web Development Workshop (Front End)
Web Development Workshop (Front End)Web Development Workshop (Front End)
Web Development Workshop (Front End)
 
The Server Side of Responsive Web Design
The Server Side of Responsive Web DesignThe Server Side of Responsive Web Design
The Server Side of Responsive Web Design
 
Universal apps lightning talk
Universal apps lightning talk Universal apps lightning talk
Universal apps lightning talk
 
Terry's Resume 3.1
Terry's Resume 3.1Terry's Resume 3.1
Terry's Resume 3.1
 
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Expbakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
bakkesh_php_mysql_javascript_jquery_5.5yrs_Exp
 
Ibm web sphere_job_interview_preparation_guide
Ibm web sphere_job_interview_preparation_guideIbm web sphere_job_interview_preparation_guide
Ibm web sphere_job_interview_preparation_guide
 
JAVASRIPT and PHP Basics# Unit 2 Webdesign
JAVASRIPT and PHP Basics# Unit 2 WebdesignJAVASRIPT and PHP Basics# Unit 2 Webdesign
JAVASRIPT and PHP Basics# Unit 2 Webdesign
 
Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)
Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)
Resume- Nishant Verma (JEE Consultant with 10+ years ) (1)
 
Isomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master ClassIsomorphic JavaScript: #DevBeat Master Class
Isomorphic JavaScript: #DevBeat Master Class
 
Why You Need a Front End Developer
Why You Need a Front End DeveloperWhy You Need a Front End Developer
Why You Need a Front End Developer
 
CVMaxSpoFormatIng
CVMaxSpoFormatIngCVMaxSpoFormatIng
CVMaxSpoFormatIng
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Apache Flex and the imperfect Web
Apache Flex and the imperfect WebApache Flex and the imperfect Web
Apache Flex and the imperfect Web
 
PykQuery.js
PykQuery.jsPykQuery.js
PykQuery.js
 
JavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin GermanJavaScript & Enterprise BED-Con 2014 Berlin German
JavaScript & Enterprise BED-Con 2014 Berlin German
 
Js il.com
Js il.comJs il.com
Js il.com
 

Más de Edward Burns

jsf2-composite-components
jsf2-composite-componentsjsf2-composite-components
jsf2-composite-components
Edward Burns
 
JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011
Edward Burns
 

Más de Edward Burns (20)

Developer Career Masterplan
Developer Career MasterplanDeveloper Career Masterplan
Developer Career Masterplan
 
Jakarta EE 11 Status Update​
Jakarta EE 11 Status Update​Jakarta EE 11 Status Update​
Jakarta EE 11 Status Update​
 
Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!
 
How modernizing enterprise applications gives you a competitive advantage
How modernizing enterprise applications gives you a competitive advantageHow modernizing enterprise applications gives you a competitive advantage
How modernizing enterprise applications gives you a competitive advantage
 
Wie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztWie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE Nutzt
 
Practical lessons from customers performing digital transformation with Azure
Practical lessons from customers performing digital transformation with AzurePractical lessons from customers performing digital transformation with Azure
Practical lessons from customers performing digital transformation with Azure
 
wls-azure-devnexus-2022.pdf
wls-azure-devnexus-2022.pdfwls-azure-devnexus-2022.pdf
wls-azure-devnexus-2022.pdf
 
Jakarta EE und Microprofile sind bei Azure zu Hause
Jakarta EE und Microprofile sind bei Azure zu HauseJakarta EE und Microprofile sind bei Azure zu Hause
Jakarta EE und Microprofile sind bei Azure zu Hause
 
Java on Your Terms with Azure
Java on Your Terms with AzureJava on Your Terms with Azure
Java on Your Terms with Azure
 
Wars I’ve Seen From Java EE to Spring and more, Azure has you covered
Wars I’ve SeenFrom Java EE to Spring and more, Azure has you coveredWars I’ve SeenFrom Java EE to Spring and more, Azure has you covered
Wars I’ve Seen From Java EE to Spring and more, Azure has you covered
 
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
HTTP/2 Comes to Java: Servlet 4.0 and what it means for the Java/Jakarta EE e...
 
Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?
 
Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?Programming Language Platform Growth: Table Stakes or Deal Makes?
Programming Language Platform Growth: Table Stakes or Deal Makes?
 
Building a Serverless State Service for the Cloud
Building a Serverless State Service for the CloudBuilding a Serverless State Service for the Cloud
Building a Serverless State Service for the Cloud
 
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute InfodeckJSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth SlidesJavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
 
jsf2-composite-components
jsf2-composite-componentsjsf2-composite-components
jsf2-composite-components
 
JSF 2.2
JSF 2.2JSF 2.2
JSF 2.2
 
Kids computer-programming
Kids computer-programmingKids computer-programming
Kids computer-programming
 
JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011JSF 2.2 Status at DOAG 2011
JSF 2.2 Status at DOAG 2011
 

Último

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Último (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 

Java EE 7 from an HTML5 Perspective, JavaLand 2015

  • 1. JAVA EE 7 FROM AN HTML5 PERSPECTIVE Ed Burns @edburns and Oliver Szymanski @source_knights
  • 2. 2 Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright 2015 Ed Burns and Oliver Szymanski
  • 3. Speaker Qualifications – Ed Burns Copyright 2015 Ed Burns and Oliver Szymanski 3 ¨  Involved with JSF since 2002 ¨  JSF Spec lead since 2003 ¤  Most fun part of the job: cleanly integrating other people’s great ideas into JSF (and hopefully improving on the in the process) ¤  Not an expert in applying JSF in practice ¨  Servlet Spec lead since 2014
  • 4. Speaker Qualifications – Ed Burns Copyright 2015 Ed Burns and Oliver Szymanski 4 ¨  Author of four books for McGraw-Hill
  • 5. Speaker Qualifications – Oliver Szymanski Copyright 2015 Ed Burns and Oliver Szymanski 5 ¨  Independent Java Enterprise Consultant ¨  Specialty in the Financial Sector ¨  JUG Founder Erlangen/Nuremberg Germany
  • 6. Speaker Qualifications – Oliver Szymanski Copyright 2015 Ed Burns and Oliver Szymanski 6 ¨  Contributing author for ¤  Heise Developer Channel ¤  S&S Entwickler ¤  Java aktuell ¤  Java Magazin
  • 7. Meet the Family Copyright 2015 Ed Burns and Oliver Szymanski 7
  • 8. Meet the Family ¨  Java API for JSON Processing ¨  Java API for WebSocket ¨  Batch Application ¨  Concurrency Utilities ¨  Caching ¨  Java Persistence Architecture ¨  … ¨  Java API for REST ¨  JavaServer Faces ¨  Servlets ¨  Expression Language ¨  Java Messaging Service ¨  Contexts and Dependency Injection ¨  Java Transaction Architecture 8 Copyright 2015 Ed Burns and Oliver Szymanski
  • 9. Meet the HTML5-Friendly Family ¨  Java API for JSON Processing ¨  Java API for WebSocket ¨  Batch Application ¨  Concurrency Utilities ¨  Caching ¨  Java Persistence Architecture ¨  … ¨  Java API for REST ¨  JavaServer Faces ¨  Servlets ¨  Expression Language ¨  Java Messaging Service ¨  Contexts and Dependency Injection ¨  Java Transaction Architecture 9 Copyright 2015 Ed Burns and Oliver Szymanski
  • 10. HTML5Why all the fuss? More cute logos at http://www.w3.org/html/logo/
  • 11. HTML5Why all the fuss? PAST AND PRESENT SERVER
  • 12.
  • 13. Classification ¨  Why? ¤  Multiple Computers ¤  Interconnections Between Them ¤  Shared State Among Them ¨  Today's production Web apps are extremely complex distributed applications. A Web App is a Distributed App
  • 14. Yeah, So What? ¨  Why does this classification matter? ¤  Because History Matters ¨  To understand the current state of web applications, we must go back to the history of distributed applications, and of the Internet itself.
  • 15.
  • 16. HTML5 ¨  Remember all the fuss about Ajax in 2006? ¤  Asynchronous ¤  JavaScript ¤  And ¤  XMLHttpRequest What’s in a name?
  • 17. HTML5 ¨  Remember all the fuss about Ajax in 2006? ¤  Asynchronous ¤  JavaScript ¤  And ¤  XMLHttpRequest ¨  Ajax is a programming technique, not a single technology What’s in a name?
  • 18. HTML4 ¨  What do people mean when they say HTML4? ¤  IE6 ¤  Not very high performance JavaScript ¤  Lots of browser tricks ¤  Use of native plugins is common ¨  HTML4 is seen as a single technology What’s in a name?
  • 19. HTML5 ¨  What do people mean when they say HTML5? ¤  “Modern” browsers ¤  A gigantic collection of related technologies n  Markup n  Offline storage n  EventSource n  DOM n  JavaScript n  CSS3 What’s in a name? n  Canvas n  Input controls n  Web components n  Application Cache n  WebSocket n  JSON n  Geolocation n  XMLHttpRequest Level 2
  • 20. HTML5 ¨  The rise of Chrome and the end of polyfill ¨  Standards have finally won ¤  How good is your standards body? n  W3C, ECMA, IETF ¤  HTML5: Microsoft, Google, Apple, what about Mozilla? ¨  Aside: ¤  Is HTML5 a bloated specification? ¤  Is JavaEE a bloated specification? ¤  What is bloat? A indicator of how old something is. ¤  http://mir.aculo.us/2010/10/19/standards-bloat-and- html5/ Is it really a big deal?
  • 21. HTML5 ¨  The death of the browser plugin: April 2010 http://www.apple.com/hotnews/thoughts-on-flash/ ¨  Where does the tension remain? ¤  Take advantage of the power in the client ¤  Minimize the complexity of distributing and maintaining the software Is it really a big deal?
  • 22. HTML5 ¨  HTML5 is a marketing term that describes a way of building the UI for a distributed system. ¤  UI processing task resides entirely in the browser Putting it in context
  • 23. What Makes a Distributed App ¨  Finding the best allocation of processing tasks to processing nodes ¤  User Interface ¤  Domain Logic ¤  Application Logic ¤  Data Persistence ¤  Communication ¤  Reliability, Security
  • 24. What Makes a Distributed App ¨  Finding the best allocation of processing tasks to processing nodes ¤  User Interface ¤  Domain Logic ¤  Application Logic ¤  Data Persistence ¤  Communication ¤  Reliability, Security
  • 25. UI Considerations ¨  The UI is the hardest part to get right ¨  The technology for building the UI is changing very rapidly, and will continue to change for the forseeable future ¨  The technology for the other aspects of application development is less volatile, more mature. ¨  The major software stack and device vendors are competing on the basis of their UI technology, as the gateway to the rest of their stack
  • 26. 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>! !
  • 27. HTML5 Friendly Markup ¨  JSF Views are written in a View Declaration Language (VDL). ¨  The standard Facelet VDL is an XML application with two kinds of elements ¤  HTML Markup ¤  JSF Components ¨  HTML Markup is passed through straight to the browser ¨  JSF Components take some action on the server, during the lifecycle` Let’s get back to basics
  • 28. HTML5 Friendly Markup ¨  Before JSF 2.2 ¤  JSF tags hide complexity of underlying HTML+script+css +images ¤  JSF “Renderer”: n  encode: markup to browser n  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
  • 29. HTML5 Friendly Markup ¨  With JSF 2.2 ¤  Pure HTML+script+css+images in the JSF page ¤  JSF Renderer handles decode from browser n  Leverage the strength of the JSF lifecycle n  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
  • 30. JSR 341 Expression Language 3.0 ¨  First introduced in JSTL 1.0 in 2004 ¨  Moved to JSP 2.0 in 2006 ¨  Unified with JSF 1.2 in JSP 2.1 in 2006 ¨  JSR 341: first independent specification in 2013 ¨  Used in JSF, JSP and CDI ¨  Key differentiator between JavaServer and non- JavaServer stacks Overview
  • 31. JSR 341 Expression Language 3.0 ¨  Lambda expressions ¨  Support for stand-alone environments ¨  New operators ¨  Static field and method reference ¨  Custom type converter ¨  Collection construction ¨  Collection operations New Feature Summary
  • 32. JSR 341 Expression Language 3.0 ¨  Same syntax as JavaSE 8, but available in EE 7 ¨  Behaves like an anonymous function ¨  Body consist of an EL expression ¨  Full access to EL environment in the body Lambda expression x -> x+1! (x,y) -> x+y! () -> 64!
  • 33. JSR 341 Expression Language 3.0 ¨  The lambda is evaluated and discarded Lambda expression: immediate evaluation (x -> x+1)(10)! !à 11! ((x,y)->x+y)(3,4) !à 7! (()->64)() ! !à 64!
  • 34. JSR 341 Expression Language 3.0 ¨  JSF Facelet page <h:dataTable rendered=!“#{user.loggedIn}”
 value="#{library.books.stream().
 filter(b->b.category == 'Comedy').
 map(b->b.title).toList()}" var="book">! <h:column>#{book.title}</h:column>! </h:dataTable>! Collection operations: examples
  • 35. What Makes a Distributed App ¨  Finding the best allocation of processing tasks to processing nodes ¤  User Interface ¤  Domain Logic ¤  Application Logic ¤  Data Persistence ¤  Communication ¤  Reliability, Security
  • 36. Java API for JSON Processing 1.0 ¨  API to parse and generate JSON ¨  Streaming API ¤  Low-level, efficient way to parse/generate JSON ¤  Provides pluggability for parsers/generators ¨  Object Model ¤  Simple, easy-to-use high-level API ¤  Implemented on top of Streaming API ¨  Binding JSON to Java objects forthcoming Overview – JSR 353
  • 37. Java API for JSON Processing 1.0 ¨  Parses JSON in a streaming way from input sources ¤  Similar to StaX’s XMLStreamReader, a pull parser ¨  Created using ¤  Json.createParser(…)! ¤  Json.createParserFactory().createParser( …)! ¨  Parser state events ¤  START_ARRAY, END_ARRAY, START_OBJECT, END_OBJECT, … Streaming API
  • 38. Java API for JSON Processing 1.0 ¨  JsonObject/JsonArray – JSON object and array structures ¤  JsonString and JsonNumber for string and number values ¨  JsonBuilder – Builds JsonObject and JsonArray ¨  JsonReader – Reads JsonObject and JsonArray from input source ¨  JsonWriter – Writes JsonObject and JsonArray to output source Object Model API
  • 39. Java API for RESTful Web Services 2.0 ¨  Client API ¨  Message Filters & Entity Interceptors ¨  Asynchronous Processing – Server & Client ¨  Hypermedia Support ¨  Common Configuration Overview – JSR 339
  • 40. Java API for RESTful Web Services 2.0 Server-side Async @Path("/async/longRunning")! public class MyResource { ! ! @GET! public void longRunningOp(@Suspended AsyncResponse ar) {! ! ar.setTimeoutHandler(new MyTimoutHandler());! ar.setTimeout(15, SECONDS);! ! Executors.newSingleThreadExecutor().submit(new Runnable() {! public void run() { ! …! ar.resume(result);! }! });! }! }!
  • 41. Java API for RESTful Web Services 2.0 Server-side Content Negotiation @Path("/")
 class ProductResource {!     @GET
     @Produces({"text/xml;qs=0.75", "application/json"})
     public Product[] getProducts() {
         . . .
     }
 }!
  • 42. Java Message Service 2.0 ¨  Less verbose ¨  Reduce boilerplate code ¨  Resource injection ¨  Connection, Session, and other objects are AutoCloseable ¨  Requires Resource Adapter for Java EE containers ¨  Simplified API in both Java SE and EE Overview – JSR 343
  • 43. Java Message Service 2.0 ¨  Make JMS objects implement AutoCloseable! ¤  Connection ! ¤  Session ! ¤  MessageProducer ! ¤  MessageConsumer ! ¤  QueueBrowser! ¨  Requires Java SE 7 Auto close resources
  • 44. @Resource(lookup = "jms/connFactory")
 ConnectionFactory cf; ! @Resource(lookup="jms/inboundQueue")! Destination dest;! ! public void sendMessage (String payload) throws JMSException {! try ( Connection conn = connectionFactory.createConnection(); ! Session session = conn.createSession();! MessageProducer producer = session.createProducer(dest);! ){ ! Message mess = sess.createTextMessage(payload); ! producer.send(mess); ! } catch(JMSException e){ ! // exception handling ! }
 }! Create closeable resources in a try- with-resources block close() is called automatically at end of block Java Message Service 2.0 Auto close resources
  • 45. @Resource(lookup = "java:global/jms/demoConnectionFactory")! ConnectionFactory connectionFactory; ! ! @Resource(lookup = "java:global/jms/demoQueue")! Queue demoQueue;! ! public void sendMessage (String payload) {! try (JMSContext context = connectionFactory.createContext();){! context.createProducer().send(demoQueue, payload);! } catch (JMSRuntimeException ex) {! // exception handling! }! }! close() is called automatically at end of block JMSContext combines Connection and Session Payload can be sent directly No checked exceptions thrown Java Message Service 2.0 Introducing JMSContext
  • 46. @Inject
 JMSContext context;! ! @Resource(lookup = "java:global/jms/demoQueue”)
 Queue demoQueue;! ! public void sendMessage(String payload) {! context.createProducer().send(demoQueue, payload);! }! Default resource definition Or @JmsConnectionFactory! 13 lines è1 line! Java Message Service 2.0 Default Data Source Definition
  • 47. What Makes a Distributed App ¨  Finding the best allocation of processing tasks to processing nodes ¤  User Interface ¤  Domain Logic ¤  Application Logic ¤  Data Persistence ¤  Communication ¤  Reliability, Security
  • 48. WebSockets ¨  Several moving parts, each with its own standard! ¤  Client: W3C JavaScript API http://dev.w3.org/html5/ websockets/ ¤  Transport: IETF RFC 6455 http://www.ietf.org/rfc/ rfc6455.txt ¤  Server: JSR-356: http://jcp.org/en/jsr/detail?id=356 ¨  Even with all these parts, it’s still very understandable ¤  Client: 17 page downs ¤  Transport: 86 page downs (about a third of which you can skip) What’s In a name?
  • 50. WebSocket ¨  It really is a Socket for the Web ¤  It just works over proxies ¨  Lets you do TCP easily in a web app ¤  Establish the connection ¤  Send messages both ways ¤  Send messages independent of timing ¤  Close the connection ¨  Two basic types: text and binary Big Picture
  • 52. WebSocketTCP over HTTP, use the Upgrade: header
  • 53. WebSocketTCP over HTTP, use the Upgrade: header
  • 54. WebSocketTCP over HTTP, use the Upgrade: header
  • 56. JavaScript/Browser Client ¨  Minimal Lifecycle ¤  new WebSocket(url)! ¤  pass in some functions n  onopen! n  onmessage! ¤  call send()! ¤  call close() ! ¨  Can connect to arbitrary servers, other than the page origin ¨  Server may enforce use of Origin header JavaScript WebSocket Object
  • 57. JavaScript/Browser ClientJavaScript WebSocket Object ¨  [Clamp] if value is out of range, truncate it to closest in- range value for that primitive type.
  • 58. Java Server ¨  Minimal Lifecycle ¤  Handshake ¤  Messaging ¤  Close ¨  All methods that deal with communication to the other endpoint are passed a javax.websocket.Session. ¨  Has nothing to do with javax.servlet.http.HttpSession. ¨  HttpSession can be obtained from Java Endpoint
  • 59. Java Server ¨  Passing Parameters ¨  example URI “/bookings/JohnSmith”: guestID is “JohnSmith” ¨  Strings and primitives supported Java Endpoint
  • 60. Java Server Two Styles ¨  Annotated ¤  The most commonly used ¤  Very easy to get started ¤  Throw it in the WAR and you’re done ¨  Programmatic ¤  If you don’t want to bake config into your .class files ¤  Must use Java inheritance Java Endpoint
  • 61. Java Server ¨  Must bootstrap via ServletContextListener! ¤  Look up the javax.websocket.server.ServerContaine r attribute ¤  It will be an instance of javax.websocket.server.ServerContaine r! ¤  Call addEndpoint(), two variants n  takes a class that is the annotated endpoint class n  takes a ServerEndpointConfig instance Programmatic Endpoint
  • 64. Java Server ¨  The ServerEndpointConfig instance ¤  getEndpointClass() returns n  annotated endpoint n  class that extends javax.websocket.Endpoint! ¤  getPath() returns the path, may contain url- template content Programmatic Endpoint
  • 65. WebSocket ¨  Send or receive text or binary messages ¤  As complete messages ¤  As sequence of partial messages ¤  Using traditional blocking I/O ¨  Send or receive WebSocket messages as pure Java Objects (kinda like Serialization) ¤  Using encode/decode mechanism ¤  Encoder/decoder for all primitive types built in ¨  Send and receive messages synchronously or asynchronously Flexible Message Processing
  • 66. 66 Safe Harbor Statement The preceding was intended to outline our general product direction. It was intended for information purposes only, and may not be incorporated into any contract. It was not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. Copyright 2015 Ed Burns and Oliver Szymanski
  • 67. Thank you67 Copyright 2015 Ed Burns and Oliver Szymanski