Oracle talk 201312132. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
3. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
15. Before we start !
❖
www.arshal.org
Download code
http://bit.ly/18FJHh7
http://www.arshal.org/2013/12/talk-at-oracle.html
17. Coming back..
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
18. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
19. JSF 2.2
❖
Pass through attributes!
❖
Flow scoped!
❖
Resource library contracts!
❖
File upload!
❖
Components!
❖
CSRF
www.arshal.org
20. JSF 2.2
❖
Pass through attributes!
❖
Flow scoped!
❖
Resource library contracts!
❖
File upload!
❖
Components!
❖
CSRF
www.arshal.org
<h:inputText value="#{passthroughBean.age}"
p:type="number"/>
22. JSF 2.2
❖
Pass through attributes!
❖
Flow scoped!
❖
Resource library contracts!
❖
File upload!
❖
Components!
❖
CSRF
www.arshal.org
<f:view contracts="#{contractsBean.contract}">
23. JSF 2.2
❖
Pass through attributes!
❖
Flow scoped!
❖
Resource library contracts!
❖
File upload!
❖
Components!
❖
CSRF
www.arshal.org
<h:inputFile value="#{fileUploadBean.file}"/>
24. JSF 2.2
❖
Pass through attributes!
❖
Flow scoped!
❖
Resource library contracts!
❖
File upload!
!❖
❖
Components!
CSRF
www.arshal.org
25. JSF 2.2
❖
Pass through attributes!
❖
Flow scoped!
❖
Resource library contracts!
❖
File upload!
❖
www.arshal.org
Components!
!❖
CSRF
<protected-views>!
<url-pattern>/jsf/file/index.xhtml</url-pattern>!
</protected-views>
26. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
28. CDI 1.1
❖
Bean discovery mode!
❖
Vetoed beans
www.arshal.org
bean-discovery-mode=“all"!
bean-discovery-mode=“annotated”!
bean-discovery-mode="none"
30. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
31. Bean Validation 1.1
❖
Custom constraints!
@NotNull(message = "{org.sample.zipcode.cannot_be_null}")!
!
public @interface ZipCode {
❖
Method validation
public String saveZip(@ZipCode String zip)
www.arshal.org
32. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
34. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
36. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
38. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
39. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
•
❖
JSONP!
•
❖
Batch Processing
www.arshal.org
•
Non blocking I/O: Check for resource
availability before trying for it.
while (input.isReady()
&& (len = input.read(b)) != -1) {
String data = new String(b, 0, len);
System.out.println("--> " + data)
}!
Improved security!
Async supported
@WebServlet(urlPatterns="/async", asyncSupported=true)!
40. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
41. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
JSONP!
❖
Batch Processing
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/
XMLSchema-instance" xsi:schemaLocation=“http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/
persistence/persistence_2_1.xsd">
<persistence-unit name="myPU" transaction-type="JTA">
<properties>
<property name=“javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name=“javax.persistence.schema-generation.create-source" value="script"/>
<property name=“javax.persistence.schema-generation.drop-source" value="script"/>
<property name=“javax.persistence.schema-generation.create-script-source" value="META-INF/create.sql"/>
<property name=“javax.persistence.schema-generation.drop-script-source" value="META-INF/drop.sql"/>
<property name=“javax.persistence.sql-load-script-source" value="META-INF/load.sql"/>
</properties>
</persistence-unit>
</persistence>
JAX - RS 2.0!
❖
Schema generation!
•
Expression Language 3.0!
❖
www.arshal.org
Bulk update/delete using criteria API
•
!
•
CriteriaBuilder builder = em.getCriteriaBuilder();!
CriteriaDelete deleteCriteria = builder.createCriteriaDelete(Student.class);
Root<Student> updateRoot = deleteCriteria.from(Student.class);
deleteCriteria.where(builder.equal(updateRoot.get(Student_.id), "1234"));
Query q = em.createQuery(deleteCriteria);
q.executeUpdate();
Unsynchronized persistence contexts
@PersistenceContext(synchronization=SynchronizationType.UNSYNCHRONIZED)!
42. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Expression Language 3.0!
❖
Web socket 1.1!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
•
•
•
Simplified!
Easier resource configuration!
JMS resource definition annotations.
43. Agenda
❖
JSF 2.2!
❖
CDI 1.1!
❖
Bean validation 1.1!
❖
Interceptors!
❖
JTA 1.2!
❖
EJB 3.2!
❖
Servlet 3.1!
❖
JPA!
❖
JMS 2.0!
❖
Web socket 1.1!
❖
Expression Language 3.0!
❖
JAX - RS 2.0!
❖
JSONP!
❖
Batch Processing
www.arshal.org
•
Lambda expression support
45. “ Good code is its own best documentation. As
you're about to add a comment, ask yourself,
"How can I improve the code so that this comment
isn't needed?" Improve the code and then
document it to make it even clearer.”