Download - Oracle talk 20131213
www.arshal.orgAgenda❖ 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.orgAgenda❖ 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.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
www.arshal.orgBefore we start !
❖ Download code http://bit.ly/18FJHh7http://www.arshal.org/2013/12/talk-at-oracle.html
www.arshal.orgBefore we start !
www.arshal.orgComing 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.orgAgenda❖ 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.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components!
❖ CSRF
www.arshal.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components!
❖ CSRF
<h:inputText value="#{passthroughBean.age}" p:type="number"/>
www.arshal.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components !
❖ CSRF
@FlowScoped(“flow1")!@FlowDefinition!flow.xml
www.arshal.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components!
❖ CSRF
<f:view contracts="#{contractsBean.contract}">
www.arshal.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components!
❖ CSRF<h:inputFile value="#{fileUploadBean.file}"/>
www.arshal.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components!
❖ CSRF
!
www.arshal.orgJSF 2.2
❖ Pass through attributes!
❖ Flow scoped!
❖ Resource library contracts!
❖ File upload!
❖ Components!
❖ CSRF!<protected-views>! <url-pattern>/jsf/file/index.xhtml</url-pattern>! </protected-views>
www.arshal.orgAgenda❖ 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.orgCDI 1.1
❖ Bean discovery mode!
❖ Vetoed beans
bean-discovery-mode=“all"!bean-discovery-mode=“annotated”!bean-discovery-mode="none"
www.arshal.orgAgenda❖ 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.orgBean Validation 1.1
❖ Custom constraints!
!
❖ Method validation
@NotNull(message = "{org.sample.zipcode.cannot_be_null}")!public @interface ZipCode {
public String saveZip(@ZipCode String zip)
www.arshal.orgAgenda❖ 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
Interceptors❖ InterceptorBinding!
❖ @AroundConstruct!
❖ Prioritisation standard!
❖ @Priority(Interceptor.Priority.APPLICATION+10), @Interceptors
www.arshal.org
www.arshal.orgAgenda❖ 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`
❖ Transactional scoped beans!
❖ @TransactionScoped!
❖ Transactional methods!
❖ @Transactional(value=Transactional.txType.Required, rollbackOn={SQLException.class, JMSException.class}, dontRollbackOn=SQLWarning.class)
www.arshal.orgAgenda❖ 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.orgEJB 3.2❖ Asynchronous bean!
❖ @Asynchronous!
❖ Non persistent timer service!
❖ @Schedule(hour="*", minute="*", second="*/5", info = "Every 5 second timer", persistent = false) !
❖ Passivation capable!
❖ @PrePassivate
www.arshal.orgAgenda❖ 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)!
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.orgAgenda❖ 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
• Schema generation! <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>
• 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)!
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
• Simplified!• Easier resource configuration!• JMS resource definition annotations.
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
• Lambda expression support
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.orgQ & A
❖ Contact Info!
❖ e-mail: [email protected]!
❖ Twitter: @aforarsh!
❖ Web: www.arshal.org
“ 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.”