SlideShare une entreprise Scribd logo
1  sur  77
Télécharger pour lire hors ligne
Java	
  EE	
  8	
  
What’s	
  new	
  on	
  the	
  Web	
  front

David	
  Delabassee	
  -­‐	
  @delabassee	
  
Oracle
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
1
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
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.
Safe	
  Harbor	
  Statement
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Context	
  
Web	
  Front	
  update	
  
Call	
  to	
  Action	
  
1
2
3
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Context	
  
Web	
  Front	
  update	
  
1
2
Context	
  
Web	
  Front	
  update	
  
Call	
  to	
  Action	
  3
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  EE	
  8
Cloud
Mobile
HTTP/2
SECURITY
Reactive	
  Programming
User	
  Experience
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Community-­‐Prioritized	
  Features
http://glassfish.org/survey
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Java	
  EE	
  8	
  Themes
• HTML5	
  /	
  Web	
  Tier	
  Enhancements	
  
• Ease	
  of	
  Development	
  
• Infrastructure	
  for	
  running	
  in	
  the	
  Cloud
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Context	
  
Web	
  Front	
  update	
  
1
2
3
Context	
  
Web	
  Front	
  update	
  
Call	
  to	
  Action	
  
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
JSRs
	
  	
  	
  Updated	
  
• Servlet	
  
• JAX-­‐RS	
  
• JavaServer	
  Faces	
  
• JSON-­‐P
	
  	
  	
  New	
  
• JSON-­‐B	
  	
  
• MVC	
  
10
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
JSON
• Java	
  API	
  for	
  JSON	
  Processing	
  	
  
• Process	
  JSON	
  
• Java	
  API	
  for	
  JSON	
  Binding	
  
• Unmarshall	
  JSON	
  to	
  Java	
  
• Marshall	
  Java	
  to	
  JSON
11
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
Java	
  API	
  for	
  JSON	
  Processing
• Keep	
  JSON-­‐P	
  spec	
  up-­‐to-­‐date	
  
• Track	
  new	
  standards	
  
• Add	
  editing	
  operations	
  to	
  JsonObject	
  and	
  JsonArray	
  
• Java	
  SE	
  8	
  
• JSON	
  Big	
  Data
12
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
• String	
  syntax	
  for	
  referencing	
  a	
  JSON	
  value	
  
	
   "/0/phone/mobile"
JSON-­‐Pointer	
  –	
  IETF	
  RFC	
  6901
13
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
JsonArray	
  contacts	
  =	
  …	
  
JsonPointer	
  pointer	
  =	
  new	
  JsonPointer("/0/name");	
  
JsonValue	
  value	
  =	
  pointer.getValue(contacts);	
  
[	
  
	
  {	
  
	
  	
  	
  	
  "name":"Duke",	
  
	
  	
  	
  	
  "gender":"M",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "home":"650-­‐123-­‐4567",	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"650-­‐234-­‐5678"}},	
  
	
  	
  {	
  
	
  	
  	
  	
  "name":"Jane",	
  
	
  	
  	
  	
  "gender":"F",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"707-­‐555-­‐9999"}}	
  
]	
  
	
  	
  
14
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
• String	
  syntax	
  for	
  referencing	
  a	
  JSON	
  value	
  
	
   “/0/name"	
  
• Methods	
  
– getValue()	
  
– JSON	
  operations:	
  add(),	
  replace(),	
  remove()
JSON-­‐Pointer	
  –	
  IETF	
  RFC	
  6901
	
  JsonPointer	
  pointer	
  =	
  new	
  JsonPointer("/0/name");	
  
	
  JsonArray	
  result	
  =	
  pointer.replace(contacts,	
  Json.createValue("Alex"));
15
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
• Patch	
  is	
  a	
  JSON	
  document	
  
– Array	
  of	
  objects	
  /	
  operations	
  for	
  modifying	
  a	
  JSON	
  document	
  
– add,	
  replace,	
  remove,	
  move,	
  copy,	
  test
JSON-­‐Patch	
  –	
  IETF	
  RFC	
  6902
[	
  
	
  	
  	
  {"op":"replace","path":"/0/phones/mobile","value":"650-­‐111-­‐222"},	
  
	
  	
  	
  {"op":"remove","path":"/1"}	
  
]
16
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
[	
  
	
  {	
  
	
  	
  "op":"replace",	
  
	
  	
  "path":"/0/phones/mobile",	
  
	
  	
  "value":"650-­‐111-­‐2222"},	
  
	
  {	
  
	
  	
  "op":"remove",	
  
	
  	
  "path":"/1"}	
  
]
[	
  
	
  {	
  
	
  	
  	
  	
  "name":"Duke",	
  
	
  	
  	
  	
  "gender":"M",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "home":"650-­‐123-­‐4567",	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"650-­‐234-­‐5678"}},	
  
	
  	
  {	
  
	
  	
  	
  	
  "name":"Jane",	
  
	
  	
  	
  	
  "gender":"F",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"707-­‐555-­‐9999"}}	
  
]	
  
	
  	
  
17
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
[	
  
	
  {	
  
	
  	
  "op":"replace",	
  
	
  	
  "path":"/0/phones/mobile",	
  
	
  	
  "value":"650-­‐111-­‐2222"},	
  
	
  {	
  
	
  	
  "op":"remove",	
  
	
  	
  "path":"/1"}	
  
]
[	
  
	
  {	
  
	
  	
  	
  	
  "name":"Duke",	
  
	
  	
  	
  	
  "gender":"M",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "home":"650-­‐123-­‐4567",	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"650-­‐111-­‐2222"}},	
  
	
  	
  {	
  
	
  	
  	
  	
  "name":"Jane",	
  
	
  	
  	
  	
  "gender":"F",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"707-­‐555-­‐9999"}}	
  
]	
  
	
  	
  
18
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
[	
  
	
  {	
  
	
  	
  "op":"replace",	
  
	
  	
  "path":"/0/phones/mobile",	
  
	
  	
  "value":"650-­‐111-­‐2222"},	
  
	
  {	
  
	
  	
  "op":"remove",	
  
	
  	
  "path":"/1"}	
  
]
[	
  
	
  {	
  
	
  	
  	
  	
  "name":"Duke",	
  
	
  	
  	
  	
  "gender":"M",	
  
	
  	
  	
  	
  "phones":{	
  
	
  	
  	
  	
  	
  	
  	
  "home":"650-­‐123-­‐4567",	
  
	
  	
  	
  	
  	
  	
  	
  "mobile":"650-­‐111-­‐2222"}}	
  
]	
  
	
  	
  
19
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
	
  JsonArray	
  target	
  =	
  …;	
  
	
  JsonArray	
  patch	
  =	
  …;	
  
	
  	
  
	
  JsonPatch	
  jsonPatch	
  =	
  new	
  JsonPatch(patch);	
  
	
  JsonArray	
  result	
  =	
  jsonPatch.apply(target);
JSON-­‐P	
  1.1
	
  JsonPatchBuilder	
  builder	
  =	
  new	
  JsonPatchBuilder();	
  
	
  JsonArray	
  result	
  =	
  builder.add("/Joe/phones/office",	
  "1234-­‐567")	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .remove("/Amy/age")	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .apply(contacts);
20
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
JSON-­‐Merge	
  Patch	
  –	
  IETF	
  RFC	
  7386
Orignal	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Patch	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  Result	
  
{"a":"b"}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":"c"}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":"c"}	
  
{"a":"b"}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"b":"c"}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":"b",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "b":"c"}	
  
{"a":"b"}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":null}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  }	
  
{"a":"b",	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":null}	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"b":"c"}	
  
	
  "b":"c"}	
  
{	
  }	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"a":	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"bb":	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"bb":	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {"ccc":	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {}}}	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  null}}}	
  
21
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
{	
  
	
  	
  	
  	
  	
  "title":	
  "Hello!",	
  
	
  	
  	
  	
  	
  "author":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "familyName":	
  null	
  
	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "tags":	
  [	
  "example"	
  ],	
  
	
  	
  	
  	
  	
  	
  "phoneNumber":	
  "+01-­‐123-­‐456-­‐7890"	
  
	
  }	
  
{	
  
	
  	
  	
  	
  "title":	
  "Goodbye!",	
  
	
  	
  	
  	
  "author":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "givenName":	
  "John",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "familyName":	
  "Doe"	
  
	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  "tags":	
  [	
  "example",	
  "sample"	
  ],	
  
	
  	
  	
  	
  	
  "content":	
  "This	
  will	
  be	
  unchanged"	
  
	
  }	
  
	
  	
  
{	
  
	
  	
  	
  	
  	
  "title":	
  "Hello!",	
  
	
  	
  	
  	
  	
  "author":	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "givenName":	
  "John"	
  
	
  	
  	
  	
  	
  	
  },	
  
	
  	
  	
  	
  	
  	
  "tags":	
  [	
  "example"	
  ],	
  
	
  	
  	
  	
  	
  	
  "content":	
  "This	
  will	
  be	
  unchanged",	
  
	
  	
  	
  	
  	
  	
  "phoneNumber":	
  "+01-­‐123-­‐456-­‐7890"	
  
	
  }	
  
	
  	
  
JSON-­‐Merge	
  Patch	
  –	
  IETF	
  RFC	
  7386
22
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
	
  JsonObject	
  contact	
  =	
  …;	
  //	
  The	
  target	
  to	
  be	
  patched	
  
	
  JsonObject	
  patch	
  =	
  …;	
  
	
  	
  
	
  JsonValue	
  output	
  =	
  JsonMergePatch.mergePatch(target,	
  patch);
JSON-­‐P	
  1.1
JSON-­‐Merge	
  Patch	
  –	
  IETF	
  RFC	
  7386
23
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
• Reverse	
  operation	
  
– Given	
  two	
  objects	
  returns	
  the	
  patch	
  to	
  apply	
  (diff)	
  
JSON-­‐Patch	
  &	
  JSON-­‐Merge	
  Patch	
  Diff
JsonValue	
  output	
  =	
  JsonMergePatch.diff(original,	
  target);	
  
JsonArray	
  diff	
  =	
  JsonPatch.diff(original,	
  target);
24
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
JSON	
  Query	
  using	
  Lambda	
  Operations
JsonArray	
  cars	
  =	
  ...;	
  
List<String>	
  audis	
  =	
  cars.getValuesAs(JsonObject.class).stream()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .filter(x-­‐>"Audi".equals(x.getString("brand")))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .map(x-­‐>(x.getString("serial"))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .collect(Collectors.toList());
25
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
JSON	
  Query	
  collecting	
  results	
  in	
  JsonArray
JsonArray	
  cars	
  =	
  ...;	
  
JsonArray	
  audis	
  =	
  cars.getValuesAs(JsonObject.class).stream()	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .filter(x-­‐>"Audi".equals(x.getString("brand")))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .map(x-­‐>(x.getString("serial"))	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  .collect(JsonCollectors.toJsonArray());
26
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐P	
  1.1
• Keep	
  JSON-­‐P	
  spec	
  up-­‐to-­‐date	
  
• Track	
  new	
  standards	
  
• Add	
  editing	
  operations	
  to	
  JsonObject	
  and	
  JsonArray	
  
• Java	
  SE	
  8	
  
• JSON	
  Big	
  Data
JSR	
  374
27
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐B
• API	
  to	
  marshal/unmarshal	
  Java	
  objects	
  to/from	
  JSON	
  
– Similar	
  to	
  JAXB	
  runtime	
  API	
  in	
  XML	
  world	
  
• Default	
  mapping	
  of	
  classes	
  to	
  JSON	
  
– Annotations	
  to	
  customize	
  the	
  default	
  mappings	
  
– JsonProperty,	
  JsonTransient,	
  JsonNillable,	
  JsonValue,	
  …
Java	
  API	
  for	
  JSON	
  Binding
28
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐B
• Draw	
  from	
  best	
  practices	
  of	
  existing	
  JSON	
  binding	
  implementations	
  
– Jackson,	
  Genson,	
  EclipseLink	
  MOXy,	
  Fleece,	
  JSON-­‐lib,	
  Gson,	
  Flexjson,	
  Json-­‐io,	
  
JSONiJ,	
  Johnzon,	
  Xstream,	
  etc.	
  
• Switch	
  JSON	
  binding	
  providers	
  
• Implementations	
  compete	
  on	
  common	
  ground
Standard	
  API
29
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JSON-­‐B
// from default JsonbBuilder instance of the default JsonbProvider
Jsonb jsonb = JsonbBuilder.create();
JsonbProvider myProvider =
JsonbProvider.provider("foo.bar.ProviderImpl");
Jsonb jsonb = JsonbBuilder.newBuilder(myProvider);
// UnMarshall
Book book = jsonb.fromJson(new File("myBook.json"), Book.class);
// Marshall
jsonb.toJson(myObject, new File(“foo.json”));
jsonb.toJson(myObject, new PrintWriter(System.out));
30
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  API	
  for	
  RESTful	
  Web	
  Services
31
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Server-­‐sent	
  Events
• Part	
  of	
  HTML5	
  standardization	
  
• Server-­‐to-­‐client	
  streaming	
  of	
  text	
  data	
  
• Media	
  type:	
  “text/event-­‐stream”	
  
• Long-­‐lived	
  HTTP	
  connection	
  
– Client	
  establishes	
  connection	
  
– Server	
  pushes	
  update	
  notifications	
  to	
  client
32
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Server-­‐sent	
  Events
• Servlet,	
  WebSocket,	
  JAX-­‐RS	
  or	
  standalone	
  API?	
  
• JAX-­‐RS	
  deemed	
  most	
  natural	
  fit	
  
– Streaming	
  HTTP	
  resources	
  already	
  supported	
  
– Small	
  extension	
  
• Server	
  API:	
  new	
  media	
  type;	
  EventOutput	
  	
  
• Client	
  API:	
  new	
  handler	
  for	
  server	
  side	
  events	
  
– Convenience	
  of	
  mixing	
  with	
  other	
  HTTP	
  operations;	
  new	
  media	
  type	
  
– Jersey	
  already	
  supports	
  SSE
33
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Server-­‐sent	
  Events
@Path("tickers")	
  
public	
  class	
  StockTicker	
  {	
  
…	
  
	
  	
  	
  @Get	
  
	
  	
  	
  @Produces("text/event-­‐stream")	
  
	
  	
  	
  public	
  EventOutput	
  getQuotes()	
  {	
  
	
  	
  	
  	
  	
  	
  	
  EventOutput	
  eo	
  =	
  new	
  EventOutput();	
  
	
  	
  	
  	
  	
  	
  	
  new	
  StockThread(eo).start()	
  
	
  	
  	
  	
  	
  	
  	
  return	
  eo;	
  
	
  	
  	
  }	
  
}
JAX-­‐RS	
  resource	
  class
34
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JAX-­‐RS	
  StockThread	
  class
class	
  StockThread	
  extends	
  Thread	
  {	
  
	
  private	
  EventOutput	
  eo;	
  
	
  …	
  
	
  @Override
public	
  void	
  run()	
  {
	
  	
  	
  	
  	
  	
  	
  try	
  {
…
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  eo.send(new	
  StockQuote("..."));	
  
	
  	
  	
  	
  	
  	
  	
  }	
  catch	
  (IOException	
  e)	
  {	
  …	
  }
}
}
Server-­‐sent	
  Events
35
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
WebTarget	
  target	
  =	
  client.target("http://example.com/tickers");	
  
EventSource	
  eventSource	
  =	
  new	
  EventSource(target)	
  {	
  
	
  	
  	
  @Override	
  
	
  	
  	
  public	
  void	
  onEvent(InboundEvent	
  inboundEvent)	
  {	
  
	
  	
  	
  	
  	
  StockQuote	
  sq	
  =	
  inboundEvent.readData(StockQuote.class);	
  
	
  	
  	
  	
  	
  //	
  ...	
  
	
  	
  	
  	
  }	
  
	
  	
  };	
  
eventSource.open();
JAX-­‐RS	
  Client
Server-­‐sent	
  Events
36
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
JAX-­‐RS	
  2.1
37
• Server-­‐sent	
  Events	
  
• Improving	
  integration	
  with	
  CDI	
  
• JSON-­‐B	
  Integration	
  
• Building	
  upon	
  the	
  hypermedia	
  API	
  
• NIO	
  support	
  in	
  providers	
  (filters,	
  interceptors,	
  …)	
  
• Reactive	
  API	
  
• JAX-­‐RS	
  resource	
  classes	
  as	
  MVC	
  controllers	
  
• …
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  Servlet
38
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
HTTP	
  1.1	
  circa	
  1999
• HoLB	
  
• HTTP	
  uses	
  TCP	
  poorly	
  
- HTTP	
  flows	
  are	
  short	
  and	
  bursty	
  
- TCP	
  was	
  built	
  for	
  long-­‐lived	
  flows	
  
• Solutions	
  
- File	
  concatenations,	
  Assets	
  Inlining,	
  Domain	
  sharding,	
  etc.
Problems	
  Vs	
  Solutions
39
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
HTTP/2
• HTTP/2	
  
– Hypertext	
  Transfer	
  Protocol	
  version	
  2	
  -­‐	
  RFC	
  7540	
  
– HPACK	
  -­‐	
  Header	
  Compression	
  for	
  HTTP/2	
  -­‐	
  RFC	
  7541	
  
• Reduce	
  latency	
  
• Address	
  the	
  HOL	
  blocking	
  problem	
  
• Support	
  parallelism	
  
• Retain	
  semantics	
  of	
  HTTP	
  1.1	
  
• Define	
  interaction	
  with	
  HTTP	
  1.x
Address	
  the	
  Limitations	
  of	
  HTTP	
  1.x
40
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
HTTP/2
• One	
  TCP	
  Connection	
  
• Request	
  -­‐>	
  Stream	
  
– Multiplexed	
  
– Prioritised	
  
• Binary	
  Framing	
  Layer	
  
– Prioritisation	
  
– Flow	
  Control	
  
– Server	
  Push	
  
• Header	
  Compression
Multiplexed	
  Binary	
  Frames POST	
  /upload	
  HTTP/1.1	
  
Host:	
  www.test.com	
  
Content-­‐Type:	
  application/json	
  
Content-­‐Length:	
  15	
  
{“name”:“duke”}
HTTP	
  1.1 HTTP/2
HEADERS	
  frame
DATA	
  frame
41
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Stream	
  Prioritization
• Stream	
  Dependency	
  in	
  HEADERS	
  Frame	
  
• PRIORITY	
  frame	
  type	
  
• An	
  additional	
  40	
  bytes	
  
- Stream	
  id	
  (31)	
  
- Weight	
  (8):	
  [1,	
  256]	
  	
  
- Exclusive	
  bit	
  (1)	
  
• Only	
  an	
  advice
A
B C
4 12
A
B CD
4 16 12
exclusive	
  =	
  0
A
B C
D
4 12
16
exclusive	
  =	
  1
42
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
HTTP/2
Server	
  Push
/index.html	
  :	
  stream	
  1	
  
/style.css	
  :	
  stream	
  2	
  
/logo.png	
  :	
  stream	
  4
Client Server
stream	
  1	
  
HEADERS
stream	
  1	
  
FRAME	
  x
stream	
  2	
  
PROMISE
stream	
  4	
  
PROMISE
43
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
HTTP/2
Header	
  Compression
44
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
Servlet	
  4.0
• Request/response	
  multiplexing	
  
– Servlet	
  Request	
  as	
  HTTP/2	
  message	
  
• Stream	
  prioritization	
  
– Add	
  stream	
  priority	
  to	
  HttpServletRequest	
  
• Server	
  push	
  
• Binary	
  framing	
  
• Upgrade	
  from	
  HTTP	
  1.1
HTTP/2	
  Features	
  in	
  Servlet	
  API
45
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Push
PushBuilder	
  builder = baseRequest.getPushBuilder();
builder.addHeader(“X-Pusher", …);
builder.path(aResource)
.etag(associated._etag)
.lastModified(associated._lastModified)
.push();
46
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Stream	
  Prioritization
47
• New	
  Priority	
  class	
  
– boolean	
  exclusive	
  
– int	
  streamId	
  
– int	
  weight	
  
• New	
  methods	
  to	
  HttpServletRequest	
  
– int	
  getStreamId()	
  
– Priority	
  getPriority()	
  
• New	
  methods	
  to	
  HttpServletResponse	
  
– int	
  getStreamId()	
  
– Priority	
  getPriority()	
  
– void	
  setPriority(Priority	
  p)	
  
• Dependency?
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved. 48
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
   49
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
   50
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
   51
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
   52
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Model-­‐View-­‐Controller
53
• Pattern	
  used	
  to	
  implement	
  a	
  User	
  Interface	
  
• Consists	
  of	
  3	
  major	
  components	
  
– Model	
  
– View	
  
– Controller	
  
• Each	
  of	
  the	
  components	
  has	
  a	
  distinct	
  responsibility
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Component-­‐based	
  MVC
• A	
  specific	
  style	
  of	
  MVC	
  made	
  popular	
  by	
  component	
  frameworks	
  
• Controller	
  provided	
  by	
  the	
  framework	
  
• Examples	
  
– JavaServer	
  Faces	
  
– Wicket	
  	
  
– Tapestry	
  
– Seam	
  (discontinued)	
  
– Apache	
  Click	
  (retired)
54
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Action-­‐based	
  MVC
• Controller(s)	
  defined	
  by	
  the	
  application	
  
• Examples	
  
– Struts	
  1	
  (end	
  of	
  life),	
  Struts	
  2	
  
– Spring	
  MVC	
  
• No	
  standard	
  Java	
  EE	
  implementation	
  
– Good	
  news	
  we	
  are	
  creating	
  one!	
  
– Targeted	
  for	
  inclusion	
  in	
  Java	
  EE	
  8
55
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Model-­‐View-­‐Controller	
  (MVC	
  1.0)	
  Specification
• “Action-­‐based”	
  MVC	
  1.0	
  JSR	
  
• Why?	
  
– UI	
  landscape	
  is	
  not	
  one	
  size	
  fits	
  all	
  	
  
– Java	
  EE	
  8	
  Community	
  Survey	
  
– Talking	
  to	
  our	
  customers,	
  etc.
JSR	
  371
56
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
MVC	
  1.0
• Action-­‐based	
  MVC	
  
• Glues	
  together	
  key	
  Java	
  EE	
  technologies	
  
– Model	
  :	
  CDI,	
  Bean	
  Validation,	
  JPA	
  
– 	
  View	
  :	
  Facelets,	
  JSP,	
  more?	
  
– 	
  Controller	
  :	
  Invent	
  new	
  technology	
  Vs.	
  Leverage	
  existing	
  technologies
57
Principles
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Controller
• Combine	
  data	
  models	
  and	
  views	
  to	
  produce	
  web	
  application	
  pages
@Path("hello")
public class HelloController {
@GET
@Controller
public String hello() {
// do something
return "hello.jsp";
}
}
58
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Controller
• Class/method	
  decorated	
  with	
  @Controller
@Path(“hello")
@Controller
public class HelloController {
@GET
@View(“hello.jsp")
public void hello() {
// do business stuff
}
}
59
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Controller
@Path(“hello")
@Controller
public class HelloController {
@GET
public Viewable hello() {
// some other stuff
return new Viewable("hello.jsp");
}
}
60
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Controller
…
@GET
@Controller
public Response getById(@PathParam("id") String id) {
if (id.length() == 0) {
return Response.status(Response.Status.BAD_REQUEST)
.entity(“error.jsp")
.build();
}
}
61
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Model
• “Refers	
  to	
  the	
  data”	
  
• CDI	
  @Named	
  bean	
  
• javax.mvc.Models	
  interface
62
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Model
@Named(“greeting”)
@RequestScoped
public class Greeting {
private String message;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
63
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Model
@Path(“hello”)
public class HelloController {
@Inject
private Models models;
@GET
@Controller
public String hello() {
models.set(“greeting”, new Greeting(“Salut”));
return “hello.jsp”;
}
}
64
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
View
• Define	
  the	
  structure	
  of	
  the	
  output	
  
• Can	
  refer	
  to	
  model(s)	
  
• Rendered	
  by	
  a	
  View	
  Engine	
  
– JSP	
  
– Facelets	
  
• Not	
  accessible	
  as	
  static	
  resources	
  
– /WEB-­‐INF/views/	
  
65
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
View
<%@ page contentType=“text/html;charset=UTF-8”
language=“java” %>
<html>
<head>
<title>Home</title>
</head>
<body>
<p>${greeting.message}</p>
</body>
</html>
66
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.	
  
View
<html>
<head>
<title>FreeMarker</title>
</head>
<body>
<p>Hello ${user}</p>
…
</body>
</html>
67
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
View	
  Engine
• CDI	
  based	
  extension	
  mechanism	
  
• javax.mvc.engine.ViewEngine interface	
  
boolean supports(String view);
void processView(ViewEngineContext context)
throws ViewEngineException;
• Ozark	
  
– JSP	
  &	
  Facelets	
  
– FreeMarker,	
  Velocity,	
  Thymeleaf,	
  Mustache,	
  Handlebars,	
  Jade,	
  AsciiDoc,	
  …
68
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Miscellaneous
• Bootstrap	
  via	
  javax.ws.rs.core.Application	
  	
  
• Validation	
  
• Exception	
  Mapping	
  Providers	
  
• New	
  @RedirectScoped	
  scope	
  
• Security	
  
• @Produces	
  
• CDI	
  Events…
69
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
MVC
• New	
  annotations	
  
– @Controller,	
  @View,	
  @csrf,	
  @RedirectScoped	
  
• Doing	
  MVC	
  now	
  is	
  not	
  a	
  bad	
  idea	
  
– Leveraging	
  CDI,	
  JAX-­‐RS,	
  Facelets,	
  BV	
  
– More?	
  Servlet	
  4.0’s	
  ServerPush	
  
– Delivering	
  an	
  easy	
  migration	
  path	
  if	
  you	
  are	
  using	
  JSPs	
  
• Offers	
  more	
  choices
70
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
JavaServer	
  Faces
71
• CDI	
  Alignment	
  
– @Inject	
  FacesContext,	
  ExternalContext,	
  etc.	
  
– CDI	
  managed	
  versions	
  of	
  Validator	
  and	
  Converter	
  
– Rely	
  on	
  CDI	
  for	
  EL	
  resolving	
  
– Invoking	
  CDI	
  managed	
  bean	
  methods	
  directly	
  from	
  Ajax,	
  etc.	
  
• “Adjustments”	
  for	
  MVC	
  
• Misc.	
  
– Multi-­‐field	
  validation,	
  etc.
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Agenda
Context	
  
Web	
  Front	
  update	
  
1
2
72
3
Context	
  
Web	
  Front	
  update	
  
Call	
  to	
  Action	
  
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Java	
  EE	
  8
• Java	
  EE	
  8	
  Platform	
  (JSR	
  366)	
  
• CDI	
  2.0	
  (JSR	
  365)	
  
• JSON	
  Binding	
  1.0	
  (JSR	
  367)	
  
• JMS	
  2.1	
  (JSR	
  368)	
  	
  
• Servlet	
  4.0	
  (JSR	
  369)	
  	
  
• JAX-­‐RS	
  2.1	
  (JSR	
  370)	
  
• MVC	
  1.0	
  (JSR	
  371)	
  	
  
• JSF	
  2.3	
  (JSR	
  372)	
  
• Java	
  EE	
  Management	
  2.0	
  (JSR	
  373)	
  
• JSON-­‐P	
  1.1	
  (JSR	
  374)	
  
• Java	
  EE	
  Security	
  1.0	
  (JSR	
  375)
So	
  far…..
73
	
  	
  	
  	
  	
  	
  Early	
  Draft	
  Review
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Roadmap
• Q4	
  2015	
  Early	
  Draft	
  
• Q1	
  2016	
  Public	
  Review	
  
• Q3	
  2016	
  Proposed	
  Final	
  Draft	
  
• H1	
  2017	
  Final	
  Release
74
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Contribute!
• Join	
  the	
  JCP	
  	
  
• “Adopt-­‐A-­‐JSR”	
  
– http://glassfish.java.net/adoptajsr	
  
• Get	
  involved	
  
– For	
  any	
  Spec,	
  join	
  users	
  mailing	
  list	
  
– Test	
  SNAPSHOT	
  and	
  milestone	
  builds	
  of	
  RIs	
  
– Tweet,	
  blog,	
  socialize	
  to	
  raise	
  awareness	
  
– Fill	
  issues!	
  
• The	
  Aquarium	
  Blog	
  
– https://blogs.oracle.com/theaquarium/
75
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.
Takk!
Copyright	
  ©	
  2015,	
  Oracle	
  and/or	
  its	
  affiliates.	
  All	
  rights	
  reserved.

Contenu connexe

Similaire à Java EE 8 - What’s new on the Web front

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 8David Delabassee
 
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 8PT.JUG
 
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
 
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.0David Delabassee
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshotJava EE 8 - An instant snapshot
Java EE 8 - An instant snapshotDavid Delabassee
 
112815 java ee8_davidd
112815 java ee8_davidd112815 java ee8_davidd
112815 java ee8_daviddTakashi Ito
 
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)David Delabassee
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateMartin Grebac
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Codemotion Tel Aviv
 
Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Bruno Borges
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJosé Paumard
 
Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_aioughydchapter
 
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Logico
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingDmitry Kornilov
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...All Things Open
 
Reactive Jersey Client
Reactive Jersey ClientReactive Jersey Client
Reactive Jersey ClientMichal Gajdos
 
Oracle Database Management REST API
Oracle Database Management REST APIOracle Database Management REST API
Oracle Database Management REST APIJeff Smith
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009Roland Tritsch
 

Similaire à Java EE 8 - What’s new on the Web front (20)

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
 
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaCro'15 - Java EE 8 - An instant snapshot - David DelabasseeJavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
JavaCro'15 - Java EE 8 - An instant snapshot - David Delabassee
 
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
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
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
 
Java EE 8 - An instant snapshot
Java EE 8 - An instant snapshotJava EE 8 - An instant snapshot
Java EE 8 - An instant snapshot
 
112815 java ee8_davidd
112815 java ee8_davidd112815 java ee8_davidd
112815 java ee8_davidd
 
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)Java EE 7 (Lyon JUG & Alpes JUG  - March 2014)
Java EE 7 (Lyon JUG & Alpes JUG - March 2014)
 
Java API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and updateJava API for JSON Binding - Introduction and update
Java API for JSON Binding - Introduction and update
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
 
Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()Presente e Futuro: Java EE.next()
Presente e Futuro: Java EE.next()
 
JAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) BridgeJAX-RS and CDI Bike the (Reactive) Bridge
JAX-RS and CDI Bike the (Reactive) Bridge
 
Java EE 7 overview
Java EE 7 overviewJava EE 7 overview
Java EE 7 overview
 
Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_Leverage integration cloud_service_for_ebs_
Leverage integration cloud_service_for_ebs_
 
Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)Java EE 8 Overview (Japanese)
Java EE 8 Overview (Japanese)
 
What’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON BindingWhat’s new in JSR 367 Java API for JSON Binding
What’s new in JSR 367 Java API for JSON Binding
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...
 
Reactive Jersey Client
Reactive Jersey ClientReactive Jersey Client
Reactive Jersey Client
 
Oracle Database Management REST API
Oracle Database Management REST APIOracle Database Management REST API
Oracle Database Management REST API
 
RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009RESTful Services and Distributed OSGi - 04/2009
RESTful Services and Distributed OSGi - 04/2009
 

Plus de David Delabassee

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best PracticesDavid Delabassee
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsDavid Delabassee
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsDavid Delabassee
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessDavid Delabassee
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffDavid Delabassee
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 updateDavid Delabassee
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016David Delabassee
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progressDavid Delabassee
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)David Delabassee
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyDavid Delabassee
 

Plus de David Delabassee (20)

JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
JVMs in Containers
JVMs in ContainersJVMs in Containers
JVMs in Containers
 
Serverless Java Challenges & Triumphs
Serverless Java Challenges & TriumphsServerless Java Challenges & Triumphs
Serverless Java Challenges & Triumphs
 
Serverless Java - Challenges and Triumphs
Serverless Java - Challenges and TriumphsServerless Java - Challenges and Triumphs
Serverless Java - Challenges and Triumphs
 
Randstad Docker meetup - Serverless
Randstad Docker meetup - ServerlessRandstad Docker meetup - Serverless
Randstad Docker meetup - Serverless
 
Java Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed BanffJava Serverless in Action - Voxxed Banff
Java Serverless in Action - Voxxed Banff
 
Serverless Kotlin
Serverless KotlinServerless Kotlin
Serverless Kotlin
 
REST in an Async World
REST in an Async WorldREST in an Async World
REST in an Async World
 
JAX-RS 2.1 Reloaded
JAX-RS 2.1 ReloadedJAX-RS 2.1 Reloaded
JAX-RS 2.1 Reloaded
 
Java EE 8 - February 2017 update
Java EE 8 - February 2017 updateJava EE 8 - February 2017 update
Java EE 8 - February 2017 update
 
Java EE Next
Java EE NextJava EE Next
Java EE Next
 
Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016Java EE Next - BeJUG JavaOne Afterglow 2016
Java EE Next - BeJUG JavaOne Afterglow 2016
 
HTTP/2 comes to Java
HTTP/2 comes to JavaHTTP/2 comes to Java
HTTP/2 comes to Java
 
Java EE 8 - Work in progress
Java EE 8 - Work in progressJava EE 8 - Work in progress
Java EE 8 - Work in progress
 
HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)HTTP/2 comes to Java (Dec. 2015 version)
HTTP/2 comes to Java (Dec. 2015 version)
 
EJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and StrategyEJB and CDI - Alignment and Strategy
EJB and CDI - Alignment and Strategy
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
HTTP/2 Comes to Java
HTTP/2 Comes to JavaHTTP/2 Comes to Java
HTTP/2 Comes to Java
 
MVC 1.0 / JSR 371
MVC 1.0 / JSR 371MVC 1.0 / JSR 371
MVC 1.0 / JSR 371
 
Avatar 2.0
Avatar 2.0Avatar 2.0
Avatar 2.0
 

Dernier

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsJean Silva
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdfAndrey Devyatkin
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxRTS corp
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shardsChristopher Curtin
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 

Dernier (20)

Strategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero resultsStrategies for using alternative queries to mitigate zero results
Strategies for using alternative queries to mitigate zero results
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
2024-04-09 - From Complexity to Clarity - AWS Summit AMS.pdf
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptx
 
2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards2024 DevNexus Patterns for Resiliency: Shuffle shards
2024 DevNexus Patterns for Resiliency: Shuffle shards
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 

Java EE 8 - What’s new on the Web front

  • 1. Java  EE  8   What’s  new  on  the  Web  front
 David  Delabassee  -­‐  @delabassee   Oracle Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   1
  • 2. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 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. Safe  Harbor  Statement
  • 3. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Context   Web  Front  update   Call  to  Action   1 2 3
  • 4. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Context   Web  Front  update   1 2 Context   Web  Front  update   Call  to  Action  3
  • 5. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  EE  8 Cloud Mobile HTTP/2 SECURITY Reactive  Programming User  Experience
  • 6. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.
  • 7. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Community-­‐Prioritized  Features http://glassfish.org/survey
  • 8. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Java  EE  8  Themes • HTML5  /  Web  Tier  Enhancements   • Ease  of  Development   • Infrastructure  for  running  in  the  Cloud
  • 9. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Context   Web  Front  update   1 2 3 Context   Web  Front  update   Call  to  Action  
  • 10. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. JSRs      Updated   • Servlet   • JAX-­‐RS   • JavaServer  Faces   • JSON-­‐P      New   • JSON-­‐B     • MVC   10
  • 11. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. JSON • Java  API  for  JSON  Processing     • Process  JSON   • Java  API  for  JSON  Binding   • Unmarshall  JSON  to  Java   • Marshall  Java  to  JSON 11
  • 12. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 Java  API  for  JSON  Processing • Keep  JSON-­‐P  spec  up-­‐to-­‐date   • Track  new  standards   • Add  editing  operations  to  JsonObject  and  JsonArray   • Java  SE  8   • JSON  Big  Data 12
  • 13. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 • String  syntax  for  referencing  a  JSON  value     "/0/phone/mobile" JSON-­‐Pointer  –  IETF  RFC  6901 13
  • 14. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 JsonArray  contacts  =  …   JsonPointer  pointer  =  new  JsonPointer("/0/name");   JsonValue  value  =  pointer.getValue(contacts);   [    {          "name":"Duke",          "gender":"M",          "phones":{                "home":"650-­‐123-­‐4567",                "mobile":"650-­‐234-­‐5678"}},      {          "name":"Jane",          "gender":"F",          "phones":{                "mobile":"707-­‐555-­‐9999"}}   ]       14
  • 15. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 • String  syntax  for  referencing  a  JSON  value     “/0/name"   • Methods   – getValue()   – JSON  operations:  add(),  replace(),  remove() JSON-­‐Pointer  –  IETF  RFC  6901  JsonPointer  pointer  =  new  JsonPointer("/0/name");    JsonArray  result  =  pointer.replace(contacts,  Json.createValue("Alex")); 15
  • 16. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 • Patch  is  a  JSON  document   – Array  of  objects  /  operations  for  modifying  a  JSON  document   – add,  replace,  remove,  move,  copy,  test JSON-­‐Patch  –  IETF  RFC  6902 [        {"op":"replace","path":"/0/phones/mobile","value":"650-­‐111-­‐222"},        {"op":"remove","path":"/1"}   ] 16
  • 17. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 [    {      "op":"replace",      "path":"/0/phones/mobile",      "value":"650-­‐111-­‐2222"},    {      "op":"remove",      "path":"/1"}   ] [    {          "name":"Duke",          "gender":"M",          "phones":{                "home":"650-­‐123-­‐4567",                "mobile":"650-­‐234-­‐5678"}},      {          "name":"Jane",          "gender":"F",          "phones":{                "mobile":"707-­‐555-­‐9999"}}   ]       17
  • 18. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 [    {      "op":"replace",      "path":"/0/phones/mobile",      "value":"650-­‐111-­‐2222"},    {      "op":"remove",      "path":"/1"}   ] [    {          "name":"Duke",          "gender":"M",          "phones":{                "home":"650-­‐123-­‐4567",                "mobile":"650-­‐111-­‐2222"}},      {          "name":"Jane",          "gender":"F",          "phones":{                "mobile":"707-­‐555-­‐9999"}}   ]       18
  • 19. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 [    {      "op":"replace",      "path":"/0/phones/mobile",      "value":"650-­‐111-­‐2222"},    {      "op":"remove",      "path":"/1"}   ] [    {          "name":"Duke",          "gender":"M",          "phones":{                "home":"650-­‐123-­‐4567",                "mobile":"650-­‐111-­‐2222"}}   ]       19
  • 20. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    JsonArray  target  =  …;    JsonArray  patch  =  …;        JsonPatch  jsonPatch  =  new  JsonPatch(patch);    JsonArray  result  =  jsonPatch.apply(target); JSON-­‐P  1.1  JsonPatchBuilder  builder  =  new  JsonPatchBuilder();    JsonArray  result  =  builder.add("/Joe/phones/office",  "1234-­‐567")                                                        .remove("/Amy/age")                                                        .apply(contacts); 20
  • 21. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 JSON-­‐Merge  Patch  –  IETF  RFC  7386 Orignal                                Patch                                      Result   {"a":"b"}                          {"a":"c"}                            {"a":"c"}   {"a":"b"}                          {"b":"c"}                            {"a":"b",                                                                                                                        "b":"c"}   {"a":"b"}                          {"a":null}                          {  }   {"a":"b",                          {"a":null}                          {"b":"c"}    "b":"c"}   {  }                                                  {"a":                                          {"a":                                                                {"bb":                                    {"bb":                                                                        {"ccc":                                {}}}                                                                                null}}}   21
  • 22. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 {            "title":  "Hello!",            "author":  {                          "familyName":  null              },              "tags":  [  "example"  ],              "phoneNumber":  "+01-­‐123-­‐456-­‐7890"    }   {          "title":  "Goodbye!",          "author":  {                  "givenName":  "John",                  "familyName":  "Doe"            },            "tags":  [  "example",  "sample"  ],            "content":  "This  will  be  unchanged"    }       {            "title":  "Hello!",            "author":  {                          "givenName":  "John"              },              "tags":  [  "example"  ],              "content":  "This  will  be  unchanged",              "phoneNumber":  "+01-­‐123-­‐456-­‐7890"    }       JSON-­‐Merge  Patch  –  IETF  RFC  7386 22
  • 23. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.    JsonObject  contact  =  …;  //  The  target  to  be  patched    JsonObject  patch  =  …;        JsonValue  output  =  JsonMergePatch.mergePatch(target,  patch); JSON-­‐P  1.1 JSON-­‐Merge  Patch  –  IETF  RFC  7386 23
  • 24. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 • Reverse  operation   – Given  two  objects  returns  the  patch  to  apply  (diff)   JSON-­‐Patch  &  JSON-­‐Merge  Patch  Diff JsonValue  output  =  JsonMergePatch.diff(original,  target);   JsonArray  diff  =  JsonPatch.diff(original,  target); 24
  • 25. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 JSON  Query  using  Lambda  Operations JsonArray  cars  =  ...;   List<String>  audis  =  cars.getValuesAs(JsonObject.class).stream()                                                    .filter(x-­‐>"Audi".equals(x.getString("brand")))                                                    .map(x-­‐>(x.getString("serial"))                                                    .collect(Collectors.toList()); 25
  • 26. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 JSON  Query  collecting  results  in  JsonArray JsonArray  cars  =  ...;   JsonArray  audis  =  cars.getValuesAs(JsonObject.class).stream()                                                                                                            .filter(x-­‐>"Audi".equals(x.getString("brand")))                                                                                                            .map(x-­‐>(x.getString("serial"))                                                                                                            .collect(JsonCollectors.toJsonArray()); 26
  • 27. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐P  1.1 • Keep  JSON-­‐P  spec  up-­‐to-­‐date   • Track  new  standards   • Add  editing  operations  to  JsonObject  and  JsonArray   • Java  SE  8   • JSON  Big  Data JSR  374 27
  • 28. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐B • API  to  marshal/unmarshal  Java  objects  to/from  JSON   – Similar  to  JAXB  runtime  API  in  XML  world   • Default  mapping  of  classes  to  JSON   – Annotations  to  customize  the  default  mappings   – JsonProperty,  JsonTransient,  JsonNillable,  JsonValue,  … Java  API  for  JSON  Binding 28
  • 29. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐B • Draw  from  best  practices  of  existing  JSON  binding  implementations   – Jackson,  Genson,  EclipseLink  MOXy,  Fleece,  JSON-­‐lib,  Gson,  Flexjson,  Json-­‐io,   JSONiJ,  Johnzon,  Xstream,  etc.   • Switch  JSON  binding  providers   • Implementations  compete  on  common  ground Standard  API 29
  • 30. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JSON-­‐B // from default JsonbBuilder instance of the default JsonbProvider Jsonb jsonb = JsonbBuilder.create(); JsonbProvider myProvider = JsonbProvider.provider("foo.bar.ProviderImpl"); Jsonb jsonb = JsonbBuilder.newBuilder(myProvider); // UnMarshall Book book = jsonb.fromJson(new File("myBook.json"), Book.class); // Marshall jsonb.toJson(myObject, new File(“foo.json”)); jsonb.toJson(myObject, new PrintWriter(System.out)); 30
  • 31. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  API  for  RESTful  Web  Services 31
  • 32. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Server-­‐sent  Events • Part  of  HTML5  standardization   • Server-­‐to-­‐client  streaming  of  text  data   • Media  type:  “text/event-­‐stream”   • Long-­‐lived  HTTP  connection   – Client  establishes  connection   – Server  pushes  update  notifications  to  client 32
  • 33. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Server-­‐sent  Events • Servlet,  WebSocket,  JAX-­‐RS  or  standalone  API?   • JAX-­‐RS  deemed  most  natural  fit   – Streaming  HTTP  resources  already  supported   – Small  extension   • Server  API:  new  media  type;  EventOutput     • Client  API:  new  handler  for  server  side  events   – Convenience  of  mixing  with  other  HTTP  operations;  new  media  type   – Jersey  already  supports  SSE 33
  • 34. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Server-­‐sent  Events @Path("tickers")   public  class  StockTicker  {   …        @Get        @Produces("text/event-­‐stream")        public  EventOutput  getQuotes()  {                EventOutput  eo  =  new  EventOutput();                new  StockThread(eo).start()                return  eo;        }   } JAX-­‐RS  resource  class 34
  • 35. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JAX-­‐RS  StockThread  class class  StockThread  extends  Thread  {    private  EventOutput  eo;    …    @Override public  void  run()  {              try  { …                      eo.send(new  StockQuote("..."));                }  catch  (IOException  e)  {  …  } } } Server-­‐sent  Events 35
  • 36. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   WebTarget  target  =  client.target("http://example.com/tickers");   EventSource  eventSource  =  new  EventSource(target)  {        @Override        public  void  onEvent(InboundEvent  inboundEvent)  {            StockQuote  sq  =  inboundEvent.readData(StockQuote.class);            //  ...          }      };   eventSource.open(); JAX-­‐RS  Client Server-­‐sent  Events 36
  • 37. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   JAX-­‐RS  2.1 37 • Server-­‐sent  Events   • Improving  integration  with  CDI   • JSON-­‐B  Integration   • Building  upon  the  hypermedia  API   • NIO  support  in  providers  (filters,  interceptors,  …)   • Reactive  API   • JAX-­‐RS  resource  classes  as  MVC  controllers   • …
  • 38. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  Servlet 38
  • 39. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   HTTP  1.1  circa  1999 • HoLB   • HTTP  uses  TCP  poorly   - HTTP  flows  are  short  and  bursty   - TCP  was  built  for  long-­‐lived  flows   • Solutions   - File  concatenations,  Assets  Inlining,  Domain  sharding,  etc. Problems  Vs  Solutions 39
  • 40. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   HTTP/2 • HTTP/2   – Hypertext  Transfer  Protocol  version  2  -­‐  RFC  7540   – HPACK  -­‐  Header  Compression  for  HTTP/2  -­‐  RFC  7541   • Reduce  latency   • Address  the  HOL  blocking  problem   • Support  parallelism   • Retain  semantics  of  HTTP  1.1   • Define  interaction  with  HTTP  1.x Address  the  Limitations  of  HTTP  1.x 40
  • 41. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   HTTP/2 • One  TCP  Connection   • Request  -­‐>  Stream   – Multiplexed   – Prioritised   • Binary  Framing  Layer   – Prioritisation   – Flow  Control   – Server  Push   • Header  Compression Multiplexed  Binary  Frames POST  /upload  HTTP/1.1   Host:  www.test.com   Content-­‐Type:  application/json   Content-­‐Length:  15   {“name”:“duke”} HTTP  1.1 HTTP/2 HEADERS  frame DATA  frame 41
  • 42. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Stream  Prioritization • Stream  Dependency  in  HEADERS  Frame   • PRIORITY  frame  type   • An  additional  40  bytes   - Stream  id  (31)   - Weight  (8):  [1,  256]     - Exclusive  bit  (1)   • Only  an  advice A B C 4 12 A B CD 4 16 12 exclusive  =  0 A B C D 4 12 16 exclusive  =  1 42
  • 43. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   HTTP/2 Server  Push /index.html  :  stream  1   /style.css  :  stream  2   /logo.png  :  stream  4 Client Server stream  1   HEADERS stream  1   FRAME  x stream  2   PROMISE stream  4   PROMISE 43
  • 44. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   HTTP/2 Header  Compression 44
  • 45. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   Servlet  4.0 • Request/response  multiplexing   – Servlet  Request  as  HTTP/2  message   • Stream  prioritization   – Add  stream  priority  to  HttpServletRequest   • Server  push   • Binary  framing   • Upgrade  from  HTTP  1.1 HTTP/2  Features  in  Servlet  API 45
  • 46. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Push PushBuilder  builder = baseRequest.getPushBuilder(); builder.addHeader(“X-Pusher", …); builder.path(aResource) .etag(associated._etag) .lastModified(associated._lastModified) .push(); 46
  • 47. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Stream  Prioritization 47 • New  Priority  class   – boolean  exclusive   – int  streamId   – int  weight   • New  methods  to  HttpServletRequest   – int  getStreamId()   – Priority  getPriority()   • New  methods  to  HttpServletResponse   – int  getStreamId()   – Priority  getPriority()   – void  setPriority(Priority  p)   • Dependency?
  • 48. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. 48
  • 49. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   49
  • 50. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   50
  • 51. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   51
  • 52. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   52
  • 53. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Model-­‐View-­‐Controller 53 • Pattern  used  to  implement  a  User  Interface   • Consists  of  3  major  components   – Model   – View   – Controller   • Each  of  the  components  has  a  distinct  responsibility
  • 54. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Component-­‐based  MVC • A  specific  style  of  MVC  made  popular  by  component  frameworks   • Controller  provided  by  the  framework   • Examples   – JavaServer  Faces   – Wicket     – Tapestry   – Seam  (discontinued)   – Apache  Click  (retired) 54
  • 55. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Action-­‐based  MVC • Controller(s)  defined  by  the  application   • Examples   – Struts  1  (end  of  life),  Struts  2   – Spring  MVC   • No  standard  Java  EE  implementation   – Good  news  we  are  creating  one!   – Targeted  for  inclusion  in  Java  EE  8 55
  • 56. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Model-­‐View-­‐Controller  (MVC  1.0)  Specification • “Action-­‐based”  MVC  1.0  JSR   • Why?   – UI  landscape  is  not  one  size  fits  all     – Java  EE  8  Community  Survey   – Talking  to  our  customers,  etc. JSR  371 56
  • 57. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   MVC  1.0 • Action-­‐based  MVC   • Glues  together  key  Java  EE  technologies   – Model  :  CDI,  Bean  Validation,  JPA   –  View  :  Facelets,  JSP,  more?   –  Controller  :  Invent  new  technology  Vs.  Leverage  existing  technologies 57 Principles
  • 58. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Controller • Combine  data  models  and  views  to  produce  web  application  pages @Path("hello") public class HelloController { @GET @Controller public String hello() { // do something return "hello.jsp"; } } 58
  • 59. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Controller • Class/method  decorated  with  @Controller @Path(“hello") @Controller public class HelloController { @GET @View(“hello.jsp") public void hello() { // do business stuff } } 59
  • 60. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Controller @Path(“hello") @Controller public class HelloController { @GET public Viewable hello() { // some other stuff return new Viewable("hello.jsp"); } } 60
  • 61. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Controller … @GET @Controller public Response getById(@PathParam("id") String id) { if (id.length() == 0) { return Response.status(Response.Status.BAD_REQUEST) .entity(“error.jsp") .build(); } } 61
  • 62. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Model • “Refers  to  the  data”   • CDI  @Named  bean   • javax.mvc.Models  interface 62
  • 63. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Model @Named(“greeting”) @RequestScoped public class Greeting { private String message; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } 63
  • 64. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Model @Path(“hello”) public class HelloController { @Inject private Models models; @GET @Controller public String hello() { models.set(“greeting”, new Greeting(“Salut”)); return “hello.jsp”; } } 64
  • 65. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. View • Define  the  structure  of  the  output   • Can  refer  to  model(s)   • Rendered  by  a  View  Engine   – JSP   – Facelets   • Not  accessible  as  static  resources   – /WEB-­‐INF/views/   65
  • 66. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. View <%@ page contentType=“text/html;charset=UTF-8” language=“java” %> <html> <head> <title>Home</title> </head> <body> <p>${greeting.message}</p> </body> </html> 66
  • 67. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.   View <html> <head> <title>FreeMarker</title> </head> <body> <p>Hello ${user}</p> … </body> </html> 67
  • 68. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. View  Engine • CDI  based  extension  mechanism   • javax.mvc.engine.ViewEngine interface   boolean supports(String view); void processView(ViewEngineContext context) throws ViewEngineException; • Ozark   – JSP  &  Facelets   – FreeMarker,  Velocity,  Thymeleaf,  Mustache,  Handlebars,  Jade,  AsciiDoc,  … 68
  • 69. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Miscellaneous • Bootstrap  via  javax.ws.rs.core.Application     • Validation   • Exception  Mapping  Providers   • New  @RedirectScoped  scope   • Security   • @Produces   • CDI  Events… 69
  • 70. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. MVC • New  annotations   – @Controller,  @View,  @csrf,  @RedirectScoped   • Doing  MVC  now  is  not  a  bad  idea   – Leveraging  CDI,  JAX-­‐RS,  Facelets,  BV   – More?  Servlet  4.0’s  ServerPush   – Delivering  an  easy  migration  path  if  you  are  using  JSPs   • Offers  more  choices 70
  • 71. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. JavaServer  Faces 71 • CDI  Alignment   – @Inject  FacesContext,  ExternalContext,  etc.   – CDI  managed  versions  of  Validator  and  Converter   – Rely  on  CDI  for  EL  resolving   – Invoking  CDI  managed  bean  methods  directly  from  Ajax,  etc.   • “Adjustments”  for  MVC   • Misc.   – Multi-­‐field  validation,  etc.
  • 72. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Agenda Context   Web  Front  update   1 2 72 3 Context   Web  Front  update   Call  to  Action  
  • 73. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Java  EE  8 • Java  EE  8  Platform  (JSR  366)   • CDI  2.0  (JSR  365)   • JSON  Binding  1.0  (JSR  367)   • JMS  2.1  (JSR  368)     • Servlet  4.0  (JSR  369)     • JAX-­‐RS  2.1  (JSR  370)   • MVC  1.0  (JSR  371)     • JSF  2.3  (JSR  372)   • Java  EE  Management  2.0  (JSR  373)   • JSON-­‐P  1.1  (JSR  374)   • Java  EE  Security  1.0  (JSR  375) So  far….. 73            Early  Draft  Review
  • 74. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Roadmap • Q4  2015  Early  Draft   • Q1  2016  Public  Review   • Q3  2016  Proposed  Final  Draft   • H1  2017  Final  Release 74
  • 75. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Contribute! • Join  the  JCP     • “Adopt-­‐A-­‐JSR”   – http://glassfish.java.net/adoptajsr   • Get  involved   – For  any  Spec,  join  users  mailing  list   – Test  SNAPSHOT  and  milestone  builds  of  RIs   – Tweet,  blog,  socialize  to  raise  awareness   – Fill  issues!   • The  Aquarium  Blog   – https://blogs.oracle.com/theaquarium/ 75
  • 76. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved. Takk!
  • 77. Copyright  ©  2015,  Oracle  and/or  its  affiliates.  All  rights  reserved.