SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
HTTP 
2 
Comes 
to 
Java 
What 
Servlet 
4.0 
Means 
to 
You 
Ed 
Burns 
and 
Shing 
Wai 
Chan 
Java 
EE 
Specifica=on 
Team 
Oracle 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
|
Safe 
Harbor 
Statement 
The 
following 
is 
intended 
to 
outline 
our 
general 
product 
direc=on. 
It 
is 
intended 
for 
informa=on 
purposes 
only, 
and 
may 
not 
be 
incorporated 
into 
any 
contract. 
It 
is 
not 
a 
commitment 
to 
deliver 
any 
material, 
code, 
or 
func=onality, 
and 
should 
not 
be 
relied 
upon 
in 
making 
purchasing 
decisions. 
The 
development, 
release, 
and 
=ming 
of 
any 
features 
or 
func=onality 
described 
for 
Oracle’s 
products 
remains 
at 
the 
sole 
discre=on 
of 
Oracle. 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
3
Our 
Plan 
for 
Your 
Time 
Investment 
Why 
HTTP 
2? 
HTTP 
2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP 
2 
Summary 
and 
Current 
Status 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
1 
2 
3 
4 
5 
S 
4
Our 
Plan 
for 
Your 
Time 
Investment 
Why 
HTTP 
2? 
HTTP 
2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP 
2 
Summary 
and 
Current 
Status 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
1 
2 
3 
4 
5 
S 
5
. 
. 
. 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Why 
HTTP 
2? 
A 
Real 
Life 
Example 
S 
index.html 
style1.css 
style2.css 
script1.js 
. 
. 
. 
script9.js 
pic1.jpg 
pic8.jpg 
photo1.png 
photo2.png 
. 
. 
.
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Why 
HTTP 
2? 
Problems 
in 
HTTP 
1.1 
• HTTP 
Pipelining 
• Head-­‐of-­‐Line 
blocking 
S 
style1.css 
style2.css 
Client 
Server 
index.html 
index.html 
style1.css 
style2.css 
script1.js 
script2.js 
. 
. 
. 
script1.js 
script2.js 
. 
. 
.
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Why 
HTTP 
2? 
Problems 
in 
HTTP 
1.1 
• Inefficient 
use 
of 
TCP 
sockets 
S 
Client 
Server 
Client 
Server 
Client 
Server 
Client 
Server 
Client 
Server 
Client 
Server
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Why 
HTTP 
2? 
What 
is 
an 
opEmizaEon? 
• Much 
of 
what 
we 
do 
in 
web-­‐apps 
is 
a 
hack 
to 
work 
around 
shortcomings 
in 
HTTP 
1.1 
– File 
concatena=on 
and 
image 
sprites 
– Domain 
sharding 
– Inlined 
assets 
E 
9
File 
Concatena=on 
and 
Image 
Sprites 
TCP 
Efficiency 
Improves 
with 
Larger 
Files 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
E 
10
File 
Concatena=on 
and 
Image 
Sprites 
TCP 
Efficiency 
Improves 
with 
Larger 
Files 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
E 
11 
• Modern 
web 
page 
now 
consists 
of 
more 
than 
90 
resources 
fetched 
from 
15 
dis=nct 
hosts 
• Solu=on: 
– Just 
work 
around 
it 
by 
shoving 
more 
than 
one 
logical 
file 
into 
one 
physical 
file. 
– Seminal 
ar=cle: 
A 
List 
Apart 
hPp://alistapart.com/arEcle/sprites 
– Useful 
tool: 
SpritePad 
hPp://spritepad.wearekiss.com/
File 
Concatena=on 
and 
Image 
Sprites 
TCP 
Efficiency 
Improves 
with 
Larger 
Files 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
E 
12 
.ic-AerospaceAndDefense-wht-on-gray, .ic-AerospaceAndDefense-wht-on-red, 
.ic-Airline-wht-on-gray, .ic-Airline-wht-on-red{ 
background: url(sprites.png) no-repeat; 
} 
.ic-AerospaceAndDefense-wht-on-gray{ 
background-position: 0 0; 
width: 80px; 
height: 80px; 
} 
.ic-AerospaceAndDefense-wht-on-red{ 
background-position: -81px 0; 
width: 80px; 
height: 80px; 
} 
.ic-Airline-wht-on-gray{ 
background-position: 0 -80px ; 
width: 80px; 
height: 80px; 
} 
.ic-Airline-wht-on-red{ 
background-position: -81px -79px ; 
width: 80px; 
height: 80px; 
}
Domain 
Sharding 
Split 
page 
resources 
across 
several 
hosts 
to 
work 
around 
browser 
limits 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
13
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Inlined 
Assets 
Base64 
Encoding 
Will 
Never 
Die 
• data 
URLs 
• <img 
src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/ 
7LZv/0jvb29t/f3//Ub/ 
/ge8WSLf/rhf/3kdbW1mxsbP//mf/// 
yH5BAAAAAAALAAAAAAQAA4…" 
/> 
E 
14
Our 
Plan 
for 
Your 
Time 
Investment 
Why 
HTTP 
2? 
HTTP 
2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP 
2 
Summary 
and 
Current 
Status 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
1 
2 
3 
4 
5 
E 
15
• Request/Response 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
mul=plexing 
• Binary 
Framing 
• Stream 
Priori=za=on 
• Server 
Push 
• Header 
Compression 
• Upgrade 
from 
HTTP 
1.1 
• ALPN 
(or 
NPN) 
• 101 
Switching 
Protocols 
16 
HTTP/2 
Big 
Ticket 
Feature 
Review 
E
HTTP/2 
Request 
Response 
Mul=plexing 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Fully 
bi-­‐direc=onal 
• Enabled 
by 
defining 
some 
terms 
– Connec&on 
A 
TCP 
socket 
– Stream 
A 
“channel” 
within 
a 
connec=on 
– Message 
A 
logical 
message, 
such 
as 
a 
request 
or 
a 
response 
– Frame 
The 
smallest 
unit 
of 
communica=on 
in 
HTTP/2. 
17 
Lets 
you 
do 
more 
things 
with 
a 
single 
TCP 
connecEon 
S
HTTP/2 
Request 
Response 
Mul=plexing 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
18 
ConnecEons, 
Streams, 
Messages, 
Frames 
S
HTTP/2 
Request 
Response 
Mul=plexing 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Once 
you 
break 
the 
communica=on 
down 
into 
frames, 
you 
can 
interweave 
the 
logical 
streams 
over 
a 
single 
TCP 
connec=on. 
• Yet 
another 
idea 
from 
the 
1960s 
is 
new 
again. 
19 
ConnecEons, 
Streams, 
Messages, 
Frames 
S
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Binary 
Framing 
• Solves 
Head-­‐Of-­‐Line 
(HOL) 
blocking 
problem 
• Type 
field 
can 
be 
DATA, 
HEADERS, 
PRIORITY, 
RST_STREAM, 
SETTINGS, 
PUSH_PROMISE, 
PING, 
GOAWAY, 
WINDOW_UPDATE, 
CONTINUATION 
20 
Enabled 
by 
dumping 
newline 
delimited 
ASCII 
S 
Length 
(24) 
Type 
(8) 
Flags 
(8) 
R Stream 
IdenEfier 
(31) 
Frame 
Payload 
(0 
…)
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Binary 
Framing 
GET 
/index.html 
HTTP/1.1 
Host: 
example.com 
Accept: 
text/html 
21 
Example 
1 
S 
HEADERS 
+ 
END_STREAM 
+ 
END_HEADERS 
:method: 
GET 
:scheme: 
htp 
:path: 
/index.html 
:authority: 
example.org 
accept: 
text/html
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Binary 
Framing 
HTTP/1.1 
200 
OK 
Content-­‐Length: 
11 
Content-­‐Type: 
text/html 
Hello 
World 
22 
Example 
2 
S 
HEADERS 
-­‐ 
END_STREAM 
+ 
END_HEADERS 
:status: 
200 
content-­‐length: 
11 
content-­‐type: 
text/html 
DATA 
+ 
END_STREAM 
Hello 
World
HTTP/2 
Stream 
Priori=za=on 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Stream 
Dependency 
in 
HEADERS 
Frame 
• PRIORITY 
frame 
type 
• An 
addi=onal 
40 
bytes 
– Stream 
id 
(31) 
– Weight 
(8): 
[1, 
256] 
– Exclusive 
bit 
(1) 
• Only 
an 
advice 
23 
S 
A 
B 
C 
4 
12 
A 
B 
D 
C 
4 
16 
12 
exclusive 
= 
0 
A 
D 
16 
B 
C 
4 
12 
exclusive 
= 
1
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
Server 
Push 
• Eliminates 
the 
need 
for 
resource 
inlining. 
• Lets 
the 
server 
populate 
the 
browser’s 
cache 
in 
advance 
of 
the 
browser 
asking 
for 
the 
resource 
to 
put 
in 
the 
cache. 
• No 
corresponding 
JavaScript 
API, 
but 
can 
be 
combined 
with 
SSE 
– Server 
pushes 
stuff 
into 
the 
browser’s 
cache. 
– Server 
uses 
SSE 
to 
tell 
the 
browser 
to 
go 
fetch 
it 
(but 
we 
know 
it’s 
already 
in 
the 
browser’s 
cache). 
24 
E
HTTP/2 
Header 
Compression 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Observa=on: 
most 
of 
the 
headers 
are 
the 
same 
in 
a 
given 
stream 
– Host: 
Accept: 
user-­‐agent: 
etc. 
• Why 
send 
them 
every 
=me? 
• Have 
the 
server 
and 
the 
client 
keep 
tables 
of 
headers, 
then 
just 
send 
references 
and 
updates 
to 
the 
tables. 
25 
Known 
as 
HPACK 
E
HTTP/2 
Upgrade 
from 
HTTP 
1.1 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Not 
secure 
– We 
have 
to 
use 
port 
80 
– Use 
exis=ng 
101 
Switching 
Protocols 
from 
HTTP 
1.1 
• Secure 
– Next 
Protocol 
Nego=a=on 
(NPN) 
– Applica=on 
Layer 
Protocol 
Nego=a=on 
26 
Secure 
or 
not-­‐secure? 
E
Our 
Plan 
for 
Your 
Time 
Investment 
Why 
HTTP 
2? 
HTTP 
2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP 
2 
Summary 
and 
Current 
Status 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
1 
2 
3 
4 
5 
E 
27
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Exis=ng 
API 
is 
designed 
for 
One 
Request 
== 
One 
Response. 
• HTTP/2 
destroys 
this 
assump=on. 
• It 
will 
be 
challenging 
to 
do 
jus=ce 
to 
the 
new 
reality 
of 
One 
Request 
== 
One 
or 
More 
Responses. 
• We 
must 
not 
simply 
bolt 
the 
“One 
or 
More 
Responses” 
concept 
onto 
some 
convenient 
part 
of 
the 
exis=ng 
API. 
28 
Challenges 
in 
Exposing 
HTTP/2 
Features 
in 
Servlet 
API 
S
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Request/Response 
mul=plexing 
• Binary 
Framing 
• Stream 
Priori=za=on 
• Server 
Push 
• Header 
Compression 
• Upgrade 
from 
HTTP 
1.1 
– ALPN 
or 
(NPN) 
– 101 
Switching 
Protocols 
29 
HTTP/2 
Features 
PotenEally 
Exposed 
in 
Servlet 
API 
S
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Add 
method 
HttpServletRequest 
and 
HttpServletResponse 
– int 
getStreamId() 
30 
HTTP/2 
Features 
PotenEally 
Exposed 
in 
Servlet 
API 
S
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Add 
a 
new 
class 
Priority 
– boolean 
exclusive 
– int 
streamId 
– int 
weight 
• Add 
method 
to 
HttpServletRequest 
– Priority 
getPriority() 
• Add 
methods 
to 
HttpServletResponse 
– Priority 
getPriority() 
– void 
setPriority(Priority 
p) 
31 
Stream 
PrioriEzaEon 
S
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Push 
resource 
to 
client 
for 
a 
given 
url 
and 
headers 
• May 
add 
callback 
for 
comple=on 
or 
error 
of 
a 
push 
• Not 
at 
all 
a 
replacement 
for 
WebSocket 
• Really 
useful 
for 
frameworks 
that 
build 
on 
Servlet, 
such 
as 
JSF 
32 
Server 
Push 
E
synthetic GET /style.css 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
33 
Servlet 
4.0 
Big 
Ticket 
New 
Features 
Server 
Push 
Browser 
Server Thread A 
servlet.service() 
GET /index.html 
Server 
discovers 
browser will 
need style.css 
and script.js 
Server Thread B 
servlet.service() 
request.dispatchPushRequest("style.css") 
request.dispatchPushRequest("script.js") 
synthetic GET /script.js 
Server Thread C 
servlet.service() 
style.css 
script.js 
index.html 
E
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Server 
Push 
Example 
of 
PotenEal 
Use 
from 
JSF 
public 
class 
FacesServlet 
implements 
Servlet 
{ 
public 
void 
service(ServletRequest 
req, 
ServletResponse 
resp) 
throws 
IOException, 
ServletException 
{ 
//.. 
HttpServletRequest 
request 
= 
(HttpServletRequest) 
req; 
try 
{ 
ResourceHandler 
handler 
= 
context.getApplication().getResourceHandler(); 
if 
(handler.isResourceRequest(context) 
|| 
request.isPushRequest()) 
{ 
handler.handleResourceRequest(context); 
} 
else 
{ 
lifecycle.attachWindow(context); 
lifecycle.execute(context); 
lifecycle.render(context); 
} 
} 
} 
E 
34
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Server 
Push 
Example 
of 
PotenEal 
Use 
from 
JSF 
public 
class 
ExternalContextImpl 
extends 
ExternalContext 
{ 
//… 
public 
String 
encodeResourceURL(String 
url) 
{ 
if 
(null 
== 
url) 
{ 
String 
message 
= 
MessageUtils.getExceptionMessageString 
(MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, 
"url"); 
throw 
new 
NullPointerException(message); 
} 
Map 
attrs 
= 
getResourceAttrs(); 
((HttpServletRequest) 
request).dispatchPushRequest(url, 
attrs); 
return 
((HttpServletResponse) 
response).encodeURL(url); 
} 
//… 
} 
E 
35
Elas=c 
Resilient 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Reac=ve 
Programming 
36 
S 
Responsive 
Message 
Driven 
image 
credit: 
reac=vemanifesto.org
Servlet 
4.0 
and 
Reac=ve 
Programming 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Non-­‐blocking 
IO 
in 
Servlet 
3.1 
– ServletInputStream 
• #setReadListener, 
#isReady 
– ServletOutputStream 
• #setWriteListener, 
#isReady 
– ReadListener 
• #onDataAvailable, 
#onAllDataRead, 
#onError 
– WriteListener 
• #onWritePossible, 
#onError 
S 
37
Servlet 
4.0 
and 
Reac=ve 
Programming 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Asynchronous 
in 
Servlet 
3.0 
– ServletRequest#startAsync 
– AsyncContext 
• #addListener, 
#dispatch, 
#complete 
– AsyncListener 
• #onComplete, 
#onError, 
#onStartAsync, 
#onTimeout 
• Event-­‐driven 
– Server-­‐Sent 
Events 
S 
38
Our 
Plan 
for 
Your 
Time 
Investment 
Why 
HTTP 
2? 
HTTP 
2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP 
2 
Summary 
and 
Current 
Status 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
1 
2 
3 
4 
5 
E 
39
Java 
SE 
9 
Support 
for 
HTTP/2 
• JEP 
110 
htp://openjdk.java.net/jeps/110 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Easy 
to 
use 
API 
• Covers 
only 
the 
most 
common 
use 
cases 
• Supports 
both 
HTTP 
1.1 
and 
2 
E 
40
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Small 
footprint 
• Two 
classes 
(working 
=tles) 
– HtpRequestGroup 
• configura=on 
for 
mul=ple 
requests 
– HtpRequest 
• one 
request/response 
interac=on 
E 
41
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
Small 
footprint 
• Blocking 
mode: 
one 
thread 
per 
request/response 
– send 
request 
– get 
response 
• Non-­‐blocking 
mode: 
handle 
mul=ple 
request/response 
interac=ons 
in 
single 
thread 
using 
non-­‐blocking 
API 
– analogous 
to 
NIO 
selectors 
E 
42
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Responses 
handled 
through 
lambda 
style 
callback 
handlers 
– invoked 
on 
the 
calling 
thread 
– Must 
allocate 
threads 
to 
responses 
manually 
• Request/Response 
bodies 
handled 
as 
InputStream/OutputStream 
Callback 
handlers 
E 
43
Java 
SE 
9 
Support 
for 
HTTP/2 
HttpRequestGroup 
group 
= 
HttpRequestGroup.create(); 
HttpRequest 
req 
= 
group.createRequest() 
.setRequestMethod("POST") 
.setRequestURI(new 
URI("http://www.foo.com/a/b") 
.setRequestBody("Param1=1,Param2=2") 
.onResponseHeader("X-­‐Foo", 
(request, 
name, 
value) 
-­‐> 
{ 
System.out.printf(" 
received 
an 
X-­‐Foo 
header"); 
}) 
.sendRequest() 
.waitForCompletion(); 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
E 
44
Java 
SE 
9 
Support 
for 
HTTP/2 
HttpRequestGroup 
group 
= 
HttpRequestGroup.create(); 
HttpRequest 
req 
= 
group.createRequest() 
… 
.onResponseBody((HttpRequest 
request, 
InputStream 
in) 
-­‐> 
{ 
if 
(request.getResponseCode() 
== 
200) 
{ 
Path 
out 
= 
Paths.get("/tmp/out"); 
try 
{ 
Files.copy(in, 
out); 
} 
finally 
{ 
in.close(); 
} 
} 
}) 
.sendRequest() 
.waitForCompletion(); 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
E 
45
Java 
SE 
9 
Support 
for 
HTTP/2 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
HTTP/2 
features 
• Nego=a=on 
of 
HTTP/2 
from 
1.1 
– ALPN 
or 
plaintext 
• Server 
Push 
– Support 
for 
PUSH_PROMISE 
frames 
• HPACK 
parameters 
E 
46
Our 
Plan 
for 
Your 
Time 
Investment 
Why 
HTTP 
2? 
HTTP 
2 
Big 
Features 
How 
Servlet 
Might 
Expose 
These 
Features 
Java 
SE 
9 
Support 
for 
HTTP 
2 
Summary 
and 
Current 
Status 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
1 
2 
3 
4 
5 
S 
47
Summary 
and 
Current 
Status 
• Servlet 
4.0 
brings 
HTTP 
2 
to 
Java 
EE 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
– 100% 
compliant 
implementa=on 
of 
HTTP 
2 
– Expose 
key 
features 
to 
the 
API 
• Server 
Push 
• Stream 
Priori=za=on 
• Request/Response 
mul=plexing 
S 
48
Summary 
and 
Current 
Status 
• JSR-­‐369 
just 
formed 
on 
22 
September 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
• Tenta=ve 
Delivery 
Schedule 
– Q3 
2014: 
expert 
group 
formed 
– Q1 
2015: 
early 
dra{ 
– Q3 
2015: 
public 
review 
– Q4 
2015: 
proposed 
final 
dra{ 
– Q3 
2016: 
final 
release 
S 
49
Safe 
Harbor 
Statement 
The 
preceding 
is 
intended 
to 
outline 
our 
general 
product 
direc=on. 
It 
is 
intended 
for 
informa=on 
purposes 
only, 
and 
may 
not 
be 
incorporated 
into 
any 
contract. 
It 
is 
not 
a 
commitment 
to 
deliver 
any 
material, 
code, 
or 
func=onality, 
and 
should 
not 
be 
relied 
upon 
in 
making 
purchasing 
decisions. 
The 
development, 
release, 
and 
=ming 
of 
any 
features 
or 
func=onality 
described 
for 
Oracle’s 
products 
remains 
at 
the 
sole 
discre=on 
of 
Oracle. 
Copyright 
© 
2014, 
Oracle 
and/or 
its 
affiliates. 
All 
rights 
reserved. 
| 
50
CON5898 What Servlet 4.0 Means To You

Contenu connexe

Tendances

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 youAlex Theedom
 
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 374Heather VanCura
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouDavid Delabassee
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015Edward Burns
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015Pavel Bucek
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015Edward Burns
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016Ed Burns
 
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 MeanAlex Theedom
 
Java EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersBruno Borges
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data ServicesChris Muir
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesPavel Bucek
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessEd Burns
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...jeckels
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot David Delabassee
 
Api design and prototype
Api design and prototypeApi design and prototype
Api design and prototypeDonghuKIM2
 
Building microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipelineBuilding microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipelineDonghuKIM2
 
API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential Oracle Korea
 

Tendances (20)

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
 
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
 
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to YouHTTP/2 Comes to Java - What Servlet 4.0 Means to You
HTTP/2 Comes to Java - What Servlet 4.0 Means to You
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
 
Burns jsf-confess-2015
Burns jsf-confess-2015Burns jsf-confess-2015
Burns jsf-confess-2015
 
MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015WebSocket in Enterprise Applications 2015
WebSocket in Enterprise Applications 2015
 
JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015JSF 2.2 Input Output JavaLand 2015
JSF 2.2 Input Output JavaLand 2015
 
HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016HTTP/2 in the Java Platform -- Java Champions call February 2016
HTTP/2 in the Java Platform -- Java Champions call February 2016
 
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 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c DevelopersJava EE 7 for WebLogic 12c Developers
Java EE 7 for WebLogic 12c Developers
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data Services
 
How to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based MicroservicesHow to Thrive on REST/WebSocket-Based Microservices
How to Thrive on REST/WebSocket-Based Microservices
 
Oracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with LessOracle WebLogic Server 12.2.1 Do More with Less
Oracle WebLogic Server 12.2.1 Do More with Less
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
Oracle WebLogic Server 12c: Seamless Oracle Database Integration (with NEC, O...
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
Api design and prototype
Api design and prototypeApi design and prototype
Api design and prototype
 
Building microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipelineBuilding microservice for api with helidon and cicd pipeline
Building microservice for api with helidon and cicd pipeline
 
API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential 
 

Similaire à CON5898 What Servlet 4.0 Means To You

2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portionmnriem
 
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 InfodeckEdward Burns
 
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...Edward Burns
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewKris Rice
 
Explore Advanced CA Release Automation Configuration Topics
Explore Advanced CA Release Automation Configuration TopicsExplore Advanced CA Release Automation Configuration Topics
Explore Advanced CA Release Automation Configuration TopicsCA Technologies
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)Pavel Bucek
 
Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Kellyn Pot'Vin-Gorman
 
What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018Jeff Smith
 
Boost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BSBoost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BSInformation Development World
 
Pushing Java EE outside of the Enterprise - Home Automation
Pushing Java EE outside of the Enterprise - Home AutomationPushing Java EE outside of the Enterprise - Home Automation
Pushing Java EE outside of the Enterprise - Home AutomationDavid Delabassee
 
Přehled portfolia Oracle Database Appliance a praktických případů v regionu EMEA
Přehled portfolia Oracle Database Appliance a praktických případů v regionu EMEAPřehled portfolia Oracle Database Appliance a praktických případů v regionu EMEA
Přehled portfolia Oracle Database Appliance a praktických případů v regionu EMEAMarketingArrowECS_CZ
 
Ebs performance tuning session feb 13 2013---Presented by Oracle
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by OracleAkash Pramanik
 
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2vasuballa
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guideSrihari
 

Similaire à CON5898 What Servlet 4.0 Means To You (20)

2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
 
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
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
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...
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
 
JAX-RS.next
JAX-RS.nextJAX-RS.next
JAX-RS.next
 
Explore Advanced CA Release Automation Configuration Topics
Explore Advanced CA Release Automation Configuration TopicsExplore Advanced CA Release Automation Configuration Topics
Explore Advanced CA Release Automation Configuration Topics
 
What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)What's next for Java API for WebSocket (JSR 356)
What's next for Java API for WebSocket (JSR 356)
 
Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016Database as a Service, Collaborate 2016
Database as a Service, Collaborate 2016
 
What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018
 
Boost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BSBoost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BS
 
Pushing Java EE outside of the Enterprise - Home Automation
Pushing Java EE outside of the Enterprise - Home AutomationPushing Java EE outside of the Enterprise - Home Automation
Pushing Java EE outside of the Enterprise - Home Automation
 
MySQL Replication
MySQL ReplicationMySQL Replication
MySQL Replication
 
Přehled portfolia Oracle Database Appliance a praktických případů v regionu EMEA
Přehled portfolia Oracle Database Appliance a praktických případů v regionu EMEAPřehled portfolia Oracle Database Appliance a praktických případů v regionu EMEA
Přehled portfolia Oracle Database Appliance a praktických případů v regionu EMEA
 
Ebs performance tuning session feb 13 2013---Presented by Oracle
Ebs performance tuning session  feb 13 2013---Presented by OracleEbs performance tuning session  feb 13 2013---Presented by Oracle
Ebs performance tuning session feb 13 2013---Presented by Oracle
 
2012 ah vegas top10 tips from aruba tac
2012 ah vegas   top10 tips from aruba tac2012 ah vegas   top10 tips from aruba tac
2012 ah vegas top10 tips from aruba tac
 
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
OOW15 - Installation, Cloning, and Configuration of Oracle E-Business Suite 12.2
 
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David DelabasseeJavaCro'15 - HTTP2 Comes to Java! - David Delabassee
JavaCro'15 - HTTP2 Comes to Java! - David Delabassee
 
Web technology-guide
Web technology-guideWeb technology-guide
Web technology-guide
 

Plus de Edward Burns

Developer Career Masterplan
Developer Career MasterplanDeveloper Career Masterplan
Developer Career MasterplanEdward Burns
 
Jakarta EE 11 Status Update​
Jakarta EE 11 Status Update​Jakarta EE 11 Status Update​
Jakarta EE 11 Status Update​Edward Burns
 
Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!Edward Burns
 
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 advantageEdward Burns
 
Wie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztWie Azure Jakarta EE Nutzt
Wie Azure Jakarta EE NutztEdward Burns
 
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 AzureEdward Burns
 
wls-azure-devnexus-2022.pdf
wls-azure-devnexus-2022.pdfwls-azure-devnexus-2022.pdf
wls-azure-devnexus-2022.pdfEdward Burns
 
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 HauseEdward Burns
 
Java on Your Terms with Azure
Java on Your Terms with AzureJava on Your Terms with Azure
Java on Your Terms with AzureEdward Burns
 
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 coveredEdward Burns
 
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?Edward Burns
 
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?Edward Burns
 
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 CloudEdward Burns
 
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 InfodeckEdward Burns
 
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 SlidesEdward Burns
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Edward Burns
 
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 talkEdward Burns
 
jsf2-composite-components
jsf2-composite-componentsjsf2-composite-components
jsf2-composite-componentsEdward Burns
 
Kids computer-programming
Kids computer-programmingKids computer-programming
Kids computer-programmingEdward Burns
 

Plus 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
 
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
 
Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013Best Practices for JSF, Gameduell 2013
Best Practices for JSF, Gameduell 2013
 
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
 
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
 

Dernier

How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 

Dernier (20)

How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 

CON5898 What Servlet 4.0 Means To You

  • 1.
  • 2. HTTP 2 Comes to Java What Servlet 4.0 Means to You Ed Burns and Shing Wai Chan Java EE Specifica=on Team Oracle Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
  • 3. Safe Harbor Statement The following is intended to outline our general product direc=on. It is intended for informa=on purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or func=onality, and should not be relied upon in making purchasing decisions. The development, release, and =ming of any features or func=onality described for Oracle’s products remains at the sole discre=on of Oracle. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 3
  • 4. Our Plan for Your Time Investment Why HTTP 2? HTTP 2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP 2 Summary and Current Status Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 S 4
  • 5. Our Plan for Your Time Investment Why HTTP 2? HTTP 2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP 2 Summary and Current Status Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 S 5
  • 6. . . . Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Why HTTP 2? A Real Life Example S index.html style1.css style2.css script1.js . . . script9.js pic1.jpg pic8.jpg photo1.png photo2.png . . .
  • 7. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Why HTTP 2? Problems in HTTP 1.1 • HTTP Pipelining • Head-­‐of-­‐Line blocking S style1.css style2.css Client Server index.html index.html style1.css style2.css script1.js script2.js . . . script1.js script2.js . . .
  • 8. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Why HTTP 2? Problems in HTTP 1.1 • Inefficient use of TCP sockets S Client Server Client Server Client Server Client Server Client Server Client Server
  • 9. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Why HTTP 2? What is an opEmizaEon? • Much of what we do in web-­‐apps is a hack to work around shortcomings in HTTP 1.1 – File concatena=on and image sprites – Domain sharding – Inlined assets E 9
  • 10. File Concatena=on and Image Sprites TCP Efficiency Improves with Larger Files Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | E 10
  • 11. File Concatena=on and Image Sprites TCP Efficiency Improves with Larger Files Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | E 11 • Modern web page now consists of more than 90 resources fetched from 15 dis=nct hosts • Solu=on: – Just work around it by shoving more than one logical file into one physical file. – Seminal ar=cle: A List Apart hPp://alistapart.com/arEcle/sprites – Useful tool: SpritePad hPp://spritepad.wearekiss.com/
  • 12. File Concatena=on and Image Sprites TCP Efficiency Improves with Larger Files Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | E 12 .ic-AerospaceAndDefense-wht-on-gray, .ic-AerospaceAndDefense-wht-on-red, .ic-Airline-wht-on-gray, .ic-Airline-wht-on-red{ background: url(sprites.png) no-repeat; } .ic-AerospaceAndDefense-wht-on-gray{ background-position: 0 0; width: 80px; height: 80px; } .ic-AerospaceAndDefense-wht-on-red{ background-position: -81px 0; width: 80px; height: 80px; } .ic-Airline-wht-on-gray{ background-position: 0 -80px ; width: 80px; height: 80px; } .ic-Airline-wht-on-red{ background-position: -81px -79px ; width: 80px; height: 80px; }
  • 13. Domain Sharding Split page resources across several hosts to work around browser limits Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 13
  • 14. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Inlined Assets Base64 Encoding Will Never Die • data URLs • <img src="data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/ 7LZv/0jvb29t/f3//Ub/ /ge8WSLf/rhf/3kdbW1mxsbP//mf/// yH5BAAAAAAALAAAAAAQAA4…" /> E 14
  • 15. Our Plan for Your Time Investment Why HTTP 2? HTTP 2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP 2 Summary and Current Status Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 E 15
  • 16. • Request/Response Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | mul=plexing • Binary Framing • Stream Priori=za=on • Server Push • Header Compression • Upgrade from HTTP 1.1 • ALPN (or NPN) • 101 Switching Protocols 16 HTTP/2 Big Ticket Feature Review E
  • 17. HTTP/2 Request Response Mul=plexing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Fully bi-­‐direc=onal • Enabled by defining some terms – Connec&on A TCP socket – Stream A “channel” within a connec=on – Message A logical message, such as a request or a response – Frame The smallest unit of communica=on in HTTP/2. 17 Lets you do more things with a single TCP connecEon S
  • 18. HTTP/2 Request Response Mul=plexing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 18 ConnecEons, Streams, Messages, Frames S
  • 19. HTTP/2 Request Response Mul=plexing Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Once you break the communica=on down into frames, you can interweave the logical streams over a single TCP connec=on. • Yet another idea from the 1960s is new again. 19 ConnecEons, Streams, Messages, Frames S
  • 20. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Binary Framing • Solves Head-­‐Of-­‐Line (HOL) blocking problem • Type field can be DATA, HEADERS, PRIORITY, RST_STREAM, SETTINGS, PUSH_PROMISE, PING, GOAWAY, WINDOW_UPDATE, CONTINUATION 20 Enabled by dumping newline delimited ASCII S Length (24) Type (8) Flags (8) R Stream IdenEfier (31) Frame Payload (0 …)
  • 21. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Binary Framing GET /index.html HTTP/1.1 Host: example.com Accept: text/html 21 Example 1 S HEADERS + END_STREAM + END_HEADERS :method: GET :scheme: htp :path: /index.html :authority: example.org accept: text/html
  • 22. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Binary Framing HTTP/1.1 200 OK Content-­‐Length: 11 Content-­‐Type: text/html Hello World 22 Example 2 S HEADERS -­‐ END_STREAM + END_HEADERS :status: 200 content-­‐length: 11 content-­‐type: text/html DATA + END_STREAM Hello World
  • 23. HTTP/2 Stream Priori=za=on Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Stream Dependency in HEADERS Frame • PRIORITY frame type • An addi=onal 40 bytes – Stream id (31) – Weight (8): [1, 256] – Exclusive bit (1) • Only an advice 23 S A B C 4 12 A B D C 4 16 12 exclusive = 0 A D 16 B C 4 12 exclusive = 1
  • 24. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 Server Push • Eliminates the need for resource inlining. • Lets the server populate the browser’s cache in advance of the browser asking for the resource to put in the cache. • No corresponding JavaScript API, but can be combined with SSE – Server pushes stuff into the browser’s cache. – Server uses SSE to tell the browser to go fetch it (but we know it’s already in the browser’s cache). 24 E
  • 25. HTTP/2 Header Compression Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Observa=on: most of the headers are the same in a given stream – Host: Accept: user-­‐agent: etc. • Why send them every =me? • Have the server and the client keep tables of headers, then just send references and updates to the tables. 25 Known as HPACK E
  • 26. HTTP/2 Upgrade from HTTP 1.1 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Not secure – We have to use port 80 – Use exis=ng 101 Switching Protocols from HTTP 1.1 • Secure – Next Protocol Nego=a=on (NPN) – Applica=on Layer Protocol Nego=a=on 26 Secure or not-­‐secure? E
  • 27. Our Plan for Your Time Investment Why HTTP 2? HTTP 2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP 2 Summary and Current Status Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 E 27
  • 28. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Exis=ng API is designed for One Request == One Response. • HTTP/2 destroys this assump=on. • It will be challenging to do jus=ce to the new reality of One Request == One or More Responses. • We must not simply bolt the “One or More Responses” concept onto some convenient part of the exis=ng API. 28 Challenges in Exposing HTTP/2 Features in Servlet API S
  • 29. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Request/Response mul=plexing • Binary Framing • Stream Priori=za=on • Server Push • Header Compression • Upgrade from HTTP 1.1 – ALPN or (NPN) – 101 Switching Protocols 29 HTTP/2 Features PotenEally Exposed in Servlet API S
  • 30. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Add method HttpServletRequest and HttpServletResponse – int getStreamId() 30 HTTP/2 Features PotenEally Exposed in Servlet API S
  • 31. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Add a new class Priority – boolean exclusive – int streamId – int weight • Add method to HttpServletRequest – Priority getPriority() • Add methods to HttpServletResponse – Priority getPriority() – void setPriority(Priority p) 31 Stream PrioriEzaEon S
  • 32. Servlet 4.0 Big Ticket New Features Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Push resource to client for a given url and headers • May add callback for comple=on or error of a push • Not at all a replacement for WebSocket • Really useful for frameworks that build on Servlet, such as JSF 32 Server Push E
  • 33. synthetic GET /style.css Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 33 Servlet 4.0 Big Ticket New Features Server Push Browser Server Thread A servlet.service() GET /index.html Server discovers browser will need style.css and script.js Server Thread B servlet.service() request.dispatchPushRequest("style.css") request.dispatchPushRequest("script.js") synthetic GET /script.js Server Thread C servlet.service() style.css script.js index.html E
  • 34. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Server Push Example of PotenEal Use from JSF public class FacesServlet implements Servlet { public void service(ServletRequest req, ServletResponse resp) throws IOException, ServletException { //.. HttpServletRequest request = (HttpServletRequest) req; try { ResourceHandler handler = context.getApplication().getResourceHandler(); if (handler.isResourceRequest(context) || request.isPushRequest()) { handler.handleResourceRequest(context); } else { lifecycle.attachWindow(context); lifecycle.execute(context); lifecycle.render(context); } } } E 34
  • 35. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Server Push Example of PotenEal Use from JSF public class ExternalContextImpl extends ExternalContext { //… public String encodeResourceURL(String url) { if (null == url) { String message = MessageUtils.getExceptionMessageString (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "url"); throw new NullPointerException(message); } Map attrs = getResourceAttrs(); ((HttpServletRequest) request).dispatchPushRequest(url, attrs); return ((HttpServletResponse) response).encodeURL(url); } //… } E 35
  • 36. Elas=c Resilient Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Reac=ve Programming 36 S Responsive Message Driven image credit: reac=vemanifesto.org
  • 37. Servlet 4.0 and Reac=ve Programming Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Non-­‐blocking IO in Servlet 3.1 – ServletInputStream • #setReadListener, #isReady – ServletOutputStream • #setWriteListener, #isReady – ReadListener • #onDataAvailable, #onAllDataRead, #onError – WriteListener • #onWritePossible, #onError S 37
  • 38. Servlet 4.0 and Reac=ve Programming Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Asynchronous in Servlet 3.0 – ServletRequest#startAsync – AsyncContext • #addListener, #dispatch, #complete – AsyncListener • #onComplete, #onError, #onStartAsync, #onTimeout • Event-­‐driven – Server-­‐Sent Events S 38
  • 39. Our Plan for Your Time Investment Why HTTP 2? HTTP 2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP 2 Summary and Current Status Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 E 39
  • 40. Java SE 9 Support for HTTP/2 • JEP 110 htp://openjdk.java.net/jeps/110 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Easy to use API • Covers only the most common use cases • Supports both HTTP 1.1 and 2 E 40
  • 41. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Small footprint • Two classes (working =tles) – HtpRequestGroup • configura=on for mul=ple requests – HtpRequest • one request/response interac=on E 41
  • 42. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | Small footprint • Blocking mode: one thread per request/response – send request – get response • Non-­‐blocking mode: handle mul=ple request/response interac=ons in single thread using non-­‐blocking API – analogous to NIO selectors E 42
  • 43. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Responses handled through lambda style callback handlers – invoked on the calling thread – Must allocate threads to responses manually • Request/Response bodies handled as InputStream/OutputStream Callback handlers E 43
  • 44. Java SE 9 Support for HTTP/2 HttpRequestGroup group = HttpRequestGroup.create(); HttpRequest req = group.createRequest() .setRequestMethod("POST") .setRequestURI(new URI("http://www.foo.com/a/b") .setRequestBody("Param1=1,Param2=2") .onResponseHeader("X-­‐Foo", (request, name, value) -­‐> { System.out.printf(" received an X-­‐Foo header"); }) .sendRequest() .waitForCompletion(); Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | E 44
  • 45. Java SE 9 Support for HTTP/2 HttpRequestGroup group = HttpRequestGroup.create(); HttpRequest req = group.createRequest() … .onResponseBody((HttpRequest request, InputStream in) -­‐> { if (request.getResponseCode() == 200) { Path out = Paths.get("/tmp/out"); try { Files.copy(in, out); } finally { in.close(); } } }) .sendRequest() .waitForCompletion(); Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | E 45
  • 46. Java SE 9 Support for HTTP/2 Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | HTTP/2 features • Nego=a=on of HTTP/2 from 1.1 – ALPN or plaintext • Server Push – Support for PUSH_PROMISE frames • HPACK parameters E 46
  • 47. Our Plan for Your Time Investment Why HTTP 2? HTTP 2 Big Features How Servlet Might Expose These Features Java SE 9 Support for HTTP 2 Summary and Current Status Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 1 2 3 4 5 S 47
  • 48. Summary and Current Status • Servlet 4.0 brings HTTP 2 to Java EE Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | – 100% compliant implementa=on of HTTP 2 – Expose key features to the API • Server Push • Stream Priori=za=on • Request/Response mul=plexing S 48
  • 49. Summary and Current Status • JSR-­‐369 just formed on 22 September Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | • Tenta=ve Delivery Schedule – Q3 2014: expert group formed – Q1 2015: early dra{ – Q3 2015: public review – Q4 2015: proposed final dra{ – Q3 2016: final release S 49
  • 50. Safe Harbor Statement The preceding is intended to outline our general product direc=on. It is intended for informa=on purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or func=onality, and should not be relied upon in making purchasing decisions. The development, release, and =ming of any features or func=onality described for Oracle’s products remains at the sole discre=on of Oracle. Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | 50