SlideShare a Scribd company logo
What's new in Java EE 7?

Java User Group Berlin Brandenburg
04.12.2013
Dirk Weil, GEDOPLAN GmbH
Dirk Weil
CEO of GEDOPLAN GmbH, Bielefeld, Germany
Java EE since 1998
Conceptual design
and implementation
Talks
Training
Books & articles

Power Workshop Java EE 7

2
Java EE
1.0

1998

1.1
1.2

1.3
1.4

2001

Annotations

2002

CDI
2006

5

What's new in Java EE 7?

2013

2010

7
6

3
Java EE-related
Specs in Java SE

Management
and Security
Technologies

Web Services
Technologies

Enterprise Application Technologies

Web Application
Technologies

Java EE
Platform

Java EE 7

What's new in Java EE 7?

Specification
Java Platform, Enterprise Edition 7
Java API for WebSocket
Java API for JSON Processing
Java Servlet 3.1
JavaServer Faces 2.2
Expression Language 3.0
JavaServer Pages 2.3
Standard Tag Library for JavaServer Pages 1.2
Batch Applications for the Java Platform
Concurrency Utilities for Java EE 1.0
Contexts and Dependency Injection for Java 1.1
Dependency Injection for Java 1.0
Bean Validation 1.1
Enterprise JavaBeans 3.2
Interceptors 1.2
Java EE Connector Architecture 1.7
Java Persistence 2.1
Common Annotations for the Java Platform 1.2
Java Message Service API 2.0
Java Transaction API 1.2
JavaMail 1.5
Java API for RESTful Web Services 2.0
Implementing Enterprise Web Services 1.3
Java API for XML-Based Web Services 2.2
Web Services Metadata for the Java Platform
Java API for XML-Based RPC 1.1 (Optional)
Java APIs for XML Messaging 1.3
Java API for XML Registries 1.0
Java Authentication Service Provider Interface for Containers 1.1
Java Authorization Contract for Containers 1.5
Java EE Application Deployment 1.2 (Optional)
J2EE Management 1.1
Debugging Support for Other Languages 1.0
Java Architecture for XML Binding 2.2
Java API for XML Processing 1.3
Java Database Connectivity 4.0
Java Management Extensions 2.0
JavaBeans Activation Framework 1.1
Streaming API for XML 1.0

Web Profile?
Java EE JSR 342
JSR 356
JSR 353
JSR 340
JSR 344
JSR 341
JSR 245
JSR 52
JSR 352
JSR 236
CDI
JSR 346
JSR 330
BV
JSR 349
EJB
JSR 345
JSR 318
JCA
JSR 322
JPA
JSR 338
JSR 250
JMS
JSR 343
JTA
JSR 907
Mail
JSR 919
JAX-RS JSR 339
JSR 109
JAX-WS JSR 224
JSR 181
JAX-RPC JSR 101
JSR 67
JAXR
JSR 93
JSR 196
JACC
JSR 115
JSR 88
JSR 77
JSR 45
JAXB
JSR 222
JAXP
JSR 206
JDBC
JSR 221
JMX
JSR 003
JAF
JSR 925
StAX
JSR 173
JSON-P
Servlet
JSF
EL
JSP
JSTL
Batch















JSF 2.2
CDI 1.1

JPA 2.1






JAX-RS 2.0



4
JavaServer Faces 2.2
Big Ticket Features
Faces Flows
Resource Library Contracts
HTML 5 Friendly Markup
Stateless Views
Several minor enhancements

What's new in Java EE 7?

5
JSF 2.2: Faces Flows
Combination of various views
Internal navigation
Dedicated entry and return views
"Subroutine"
Embeddable
Flow scoped values
and beans

What's new in Java EE 7?

6
JSF 2.2: Faces Flows
Various flow definitions
Simple, directory-based
Flow descriptor
CDI Producer
Location
Web app root
Library JAR
META-INF/flows

What's new in Java EE 7?

7
JSF 2.2: Resource Library Contracts
Encapsulation of templates, images, CSS, JS
Subdirectory of
WebappRoot/contracts
Library JAR
META-INF/contracts

What's new in Java EE 7?

8
JSF 2.2: Resource Library Contracts
Activation
f:view

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core" …>
<f:view contracts="default">

faces-config.xml
<faces-config version="2.2" …>
<application>
<resource-library-contracts>
<contract-mapping>
<url-pattern>*</url-pattern>
<contracts>jugbb</contracts>
</contract-mapping>
</resource-library-contracts>
What's new in Java EE 7?

9
JSF 2.2: HTML 5 Friendly Markup
Passthrough elements:
Use HTML 5 tags with JSF attributes
<input jsf:id="email" jsf:value="#{demoModel.email}“
type="email" name="email" size="40" required="required"/>

Passthrough attributes:
Use JSF tags with HTML 5 attributes
<h:inputText id="nights" value="#{demoModel.nights}" >
<f:passThroughAttribute name="type" value="number" />
<f:passThroughAttribute name="size" value="40" />
</h:inputText>

What's new in Java EE 7?

10
JSF 2.2: More Changes
Stateless Views
<f:view transient="true">
UIData supports Collection
@ViewScoped
javax.faces.bean deprecated in next version
(@ManagedBean etc.)

What's new in Java EE 7?

11
Java Persistence API 2.1
Converter
JPQL & Criteria Query Enhancements
CDI Injection in Entity Listener
DDL Handling
Entity Graphs

What's new in Java EE 7?

12
JPA 2.1: Converter
@Convert
Explicit type / value mapping
replaces „User Types“ etc.
generalizes @Enumerated, @Temporal
@Entity
public class Country
{
@Convert(converter = YesNoConverter.class)
private boolean expired;

What's new in Java EE 7?

13
JPA 2.1: Converter
@Converter
declares converter
can be auto-applied (autoApply = true)
@Converter
public class YesNoConverter implements AttributeConverter<Boolean, String> {
public String convertToDatabaseColumn(Boolean fieldValue) {
if (fieldValue == null) return null;
return fieldValue ? "Y" : "N";
}
public Boolean convertToEntityAttribute(String columnValue) {
if (columnValue == null) return null;
return columnValue.equals("Y");

What's new in Java EE 7?

14
JPA 2.1: JPQL & Criteria Query Enhancements
ON: Join filter

select p.name, count(b)
from Publisher p
left join p.books b
on b.bookType = BookType.PAPERBACK
group by p.name

TREAT: Downcast (includes filter)
select s from StorageLocation s
where treat(s.product as Book).bookType = BookType.HARDCOVER

FUNCTION: Call DB function
select c from Customer c
where function('hasGoodCredit', c.balance, c.creditLimit)

What's new in Java EE 7?

15
JPA 2.1: JPQL & Criteria Query Enhancements
Bulk Update/Delete for Criteria Query
CriteriaUpdate<Product> criteriaUpdate
= criteriaBuilder.createCriteriaUpdate(Product.class);
Root<Product> p = criteriaUpdate.from(Product.class);
Path<Number> price = p.get(Product_.price);
criteriaUpdate.set(price, criteriaBuilder.prod(price, 1.03));

entityManager.createQuery(criteriaUpdate).executeUpdate();

Stored Procedure Queries
StoredProcedureQuery query
= entityManager.createStoredProcedureQuery("findMissingProducts");
What's new in Java EE 7?

16
JPA 2.1: CDI Injection in Entity Listener

public class CountryListener {
@Inject
private AuditService auditService;
@PreUpdate
public void preUpdate(Object entity) {
this.auditService.logUpdate(entity);
}
@Entity
@EntityListeners(CountryListener.class)
public class Country {

What's new in Java EE 7?

17
JPA 2.1: DDL Handling
Create and/or drop db tables
Based on entity meta data (mapping)
SQL script
Data load script
<persistence … >
<persistence-unit name="test">
…
<properties>
<property name="javax.persistence.schema-generation.database.action"
value="drop-and-create" />
<property name="javax.persistence.schema-generation.create-script-source"
value="META-INF/create.sql" />
<property name="javax.persistence.schema-generation.create-source"
value="metadata-then-script" />
<property name="javax.persistence.sql-load-script-source"
value="META-INF/sqlLoad.sql" />
What's new in Java EE 7?

18
JPA 2.1: DDL Handling
Write create and/or drop scripts
Writer createWriter = …; // File, String …

Map<String, Object> properties = new HashMap<>();
properties.put("javax.persistence.schema-generation.scripts.action",
"create");
properties.put("javax.persistence.schema-generation.scripts.create-target",
createWriter);
Persistence.generateSchema("test", properties);

What's new in Java EE 7?

19
JPA 2.1: Entity Graphs
Declaration of lazy attributes to be loaded
@Entity
@NamedEntityGraph(name = "Publisher_books",
attributeNodes = @NamedAttributeNode(value = "books")))
public class Publisher
{
…
@OneToMany(mappedBy = "publisher", fetch = FetchType.LAZY)
private List<Book> books;

find parameter or query hint
fetchgraph: Fetch entity graph attributes only
loadgraph: Fetch eager attributes also
TypedQuery<Publisher> query = entityManager.createQuery(…);
query.setHint("javax.persistence.fetchgraph", "Publisher_books");
What's new in Java EE 7?

20
CDI 1.1
Enhanced bean discovery
Global enablement of interceptors, decorators, alternatives
Constructor interception
Transaction support
Validation for parameters and return values

What's new in Java EE 7?

21
CDI 1.1: Bean Discovery
Discovery mode: all, annotated, none
Exclusion filter: Class or package
<beans … bean-discovery-mode="all" version="1.1">

<scan>
<exclude name="de.gedoplan.….sub1.beans.DiscoverableBean12"/>
<exclude name="de.gedoplan.….sub1.beans.excluded.**"/>
<exclude name="de.gedoplan.….dummy.**">
<if-system-property name="NO_DUMMY" value="true" />
</exclude>
</scan>
</beans>

What's new in Java EE 7?

22
CDI 1.1: Global Enablement of Interceptors etc.
@Priority
Interceptors & decorators
global enablement
Order
@TraceCall
@Interceptor
@Priority(Interceptor.Priority.APPLICATION + 1)
public class TraceCallInterceptor
{

Alternatives
Global activation of alternative with highest priority

What's new in Java EE 7?

23
CDI 1.1: Constructor Interception
@TraceCall @Interceptor @Priority(…)
public class TraceCallInterceptor
{
@AroundConstruct
public Object traceConstructorCall(InvocationContext ic)
throws Exception
{
…
}
@AroundInvoke
public Object traceMethodCall(InvocationContext ic)
throws Exception
{
…
}
What's new in Java EE 7?

24
CDI 1.1: Transaction Support
Platform global transaction interceptor @Transactional
TX modes like EJB TX attributes
@Transactional(value = TxType.REQUIRED,
dontRollbackOn={HarmlessException.class})
public void insert(Cocktail cocktail)
{

CDI scope @TransactionScoped

What's new in Java EE 7?

25
CDI 1.1: Bean Validation for Parameters and Return Values

@NotNull
public List<Questionnaire> createPoll(@Min(10) int
{

What's new in Java EE 7?

size)

26
Restful Webservices (JAX-RS)
Out-of-the-Box
JSON Support

@Path("country")
@Produces(MediaType.APPLICATION_JSON)
public class CountryResource
{
@GET
public List<Country> getAll()
{
…

Client API
Client client = ClientBuilder.newClient();
WebTarget target = client.target(“http://.../country/DE");
Country country = target.request(MediaType.APPLICATION_XML)
.get(Country.class);

What's new in Java EE 7?

27
More new things
Websockets
Concurrency Utilities
Batch

JMS

What's new in Java EE 7?

28
Platforms
GlassFish 4
Reference implementation
Stable version: 4.0
Promoted build: 4.0.1 b03
WildFly 8
Formerly known as JBoss AS
Current version: 8.0.0.Beta1

What's new in Java EE 7?

29
Links
Sample Project

https://github.com/dirkweil/whatsNewInJavaEe7
Java EE Blog

http://javaeeblog.wordpress.com/
Consulting

http://www.gedoplan.de
dirk.weil@gedoplan.de
Training

http://www.ips-it-schulungen.de/
What's new in Java EE 7?

30
Schön, dass Sie da waren!

dirk.weil@gedoplan.de

More Related Content

What's hot

Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
guest11106b
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
kamal kotecha
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
javatwo2011
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
elliando dias
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
Hendrik Ebbers
 
Dao pattern
Dao patternDao pattern
Dao pattern
ciriako
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
Ram132
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)
ejlp12
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
ejlp12
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
Guo Albert
 
Jpa
JpaJpa
jpa-hibernate-presentation
jpa-hibernate-presentationjpa-hibernate-presentation
jpa-hibernate-presentation
John Slick
 
Hibernate inheritance and relational mappings with examples
Hibernate inheritance and relational mappings with examplesHibernate inheritance and relational mappings with examples
Hibernate inheritance and relational mappings with examples
Er. Gaurav Kumar
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
Rahul Jain
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
Mohammad Faizan
 
Hibernate tutorial
Hibernate tutorialHibernate tutorial
Hibernate tutorial
Mumbai Academisc
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
Aneega
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
Subin Sugunan
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
IMC Institute
 
Alternatives of JPA/Hibernate
Alternatives of JPA/HibernateAlternatives of JPA/Hibernate
Alternatives of JPA/Hibernate
Sunghyouk Bae
 

What's hot (20)

Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Java Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and ExampleJava Hibernate Programming with Architecture Diagram and Example
Java Hibernate Programming with Architecture Diagram and Example
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
 
Dao pattern
Dao patternDao pattern
Dao pattern
 
Hibernate Tutorial
Hibernate TutorialHibernate Tutorial
Hibernate Tutorial
 
Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)Introduction to JPA (JPA version 2.0)
Introduction to JPA (JPA version 2.0)
 
Java EE Introduction
Java EE IntroductionJava EE Introduction
Java EE Introduction
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
Jpa
JpaJpa
Jpa
 
jpa-hibernate-presentation
jpa-hibernate-presentationjpa-hibernate-presentation
jpa-hibernate-presentation
 
Hibernate inheritance and relational mappings with examples
Hibernate inheritance and relational mappings with examplesHibernate inheritance and relational mappings with examples
Hibernate inheritance and relational mappings with examples
 
Hibernate tutorial for beginners
Hibernate tutorial for beginnersHibernate tutorial for beginners
Hibernate tutorial for beginners
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 
Hibernate tutorial
Hibernate tutorialHibernate tutorial
Hibernate tutorial
 
Hibernate ppt
Hibernate pptHibernate ppt
Hibernate ppt
 
Entity Persistence with JPA
Entity Persistence with JPAEntity Persistence with JPA
Entity Persistence with JPA
 
Java Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet AdvancedJava Web Programming [3/9] : Servlet Advanced
Java Web Programming [3/9] : Servlet Advanced
 
Alternatives of JPA/Hibernate
Alternatives of JPA/HibernateAlternatives of JPA/Hibernate
Alternatives of JPA/Hibernate
 

Similar to JUG Berlin Brandenburg: What's new in Java EE 7?

Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Red Hat Developers
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
Pinaki Poddar
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
Carol McDonald
 
Java EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's QuarrelJava EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's Quarrel
Mauricio "Maltron" Leal
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New Features
Shahzad Badar
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
Allan Huang
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
Josué Neis
 
What's new in Java EE 7
What's new in Java EE 7What's new in Java EE 7
What's new in Java EE 7
gedoplan
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
knight1128
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
Dmitry Buzdin
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
Sunghyouk Bae
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
Arun Gupta
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser Comparison
Allan Huang
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
Jagadish Prasath
 
What's new and noteworthy in Java EE 8?
What's new and noteworthy in Java EE 8?What's new and noteworthy in Java EE 8?
What's new and noteworthy in Java EE 8?
gedoplan
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
Oracle
 
Jpa 2.0 in java ee 6 part ii
Jpa 2.0 in java ee 6  part iiJpa 2.0 in java ee 6  part ii
Jpa 2.0 in java ee 6 part ii
Lars Lemos
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
Arun Gupta
 
WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0
Jeffrey West
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
Hirofumi Iwasaki
 

Similar to JUG Berlin Brandenburg: What's new in Java EE 7? (20)

Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
Boost Development With Java EE7 On EAP7 (Demitris Andreadis)
 
Slice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed PersistenceSlice: OpenJPA for Distributed Persistence
Slice: OpenJPA for Distributed Persistence
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
 
Java EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's QuarrelJava EE 6 & Spring: A Lover's Quarrel
Java EE 6 & Spring: A Lover's Quarrel
 
Java ee 7 New Features
Java ee 7   New FeaturesJava ee 7   New Features
Java ee 7 New Features
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 
What's new in Java EE 7
What's new in Java EE 7What's new in Java EE 7
What's new in Java EE 7
 
Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능Jdk(java) 7 - 6 기타기능
Jdk(java) 7 - 6 기타기능
 
Java 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for youJava 7 and 8, what does it mean for you
Java 7 and 8, what does it mean for you
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
 
Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011Java EE 6 workshop at Dallas Tech Fest 2011
Java EE 6 workshop at Dallas Tech Fest 2011
 
Java JSON Parser Comparison
Java JSON Parser ComparisonJava JSON Parser Comparison
Java JSON Parser Comparison
 
Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014Java EE 7 in practise - OTN Hyderabad 2014
Java EE 7 in practise - OTN Hyderabad 2014
 
What's new and noteworthy in Java EE 8?
What's new and noteworthy in Java EE 8?What's new and noteworthy in Java EE 8?
What's new and noteworthy in Java EE 8?
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Jpa 2.0 in java ee 6 part ii
Jpa 2.0 in java ee 6  part iiJpa 2.0 in java ee 6  part ii
Jpa 2.0 in java ee 6 part ii
 
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUGThe Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
 
WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0WebLogic Developer Webcast 1: JPA 2.0
WebLogic Developer Webcast 1: JPA 2.0
 
Future of Java EE with Java SE 8
Future of Java EE with Java SE 8Future of Java EE with Java SE 8
Future of Java EE with Java SE 8
 

Recently uploaded

Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 

Recently uploaded (20)

Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 

JUG Berlin Brandenburg: What's new in Java EE 7?

  • 1. What's new in Java EE 7? Java User Group Berlin Brandenburg 04.12.2013 Dirk Weil, GEDOPLAN GmbH
  • 2. Dirk Weil CEO of GEDOPLAN GmbH, Bielefeld, Germany Java EE since 1998 Conceptual design and implementation Talks Training Books & articles Power Workshop Java EE 7 2
  • 4. Java EE-related Specs in Java SE Management and Security Technologies Web Services Technologies Enterprise Application Technologies Web Application Technologies Java EE Platform Java EE 7 What's new in Java EE 7? Specification Java Platform, Enterprise Edition 7 Java API for WebSocket Java API for JSON Processing Java Servlet 3.1 JavaServer Faces 2.2 Expression Language 3.0 JavaServer Pages 2.3 Standard Tag Library for JavaServer Pages 1.2 Batch Applications for the Java Platform Concurrency Utilities for Java EE 1.0 Contexts and Dependency Injection for Java 1.1 Dependency Injection for Java 1.0 Bean Validation 1.1 Enterprise JavaBeans 3.2 Interceptors 1.2 Java EE Connector Architecture 1.7 Java Persistence 2.1 Common Annotations for the Java Platform 1.2 Java Message Service API 2.0 Java Transaction API 1.2 JavaMail 1.5 Java API for RESTful Web Services 2.0 Implementing Enterprise Web Services 1.3 Java API for XML-Based Web Services 2.2 Web Services Metadata for the Java Platform Java API for XML-Based RPC 1.1 (Optional) Java APIs for XML Messaging 1.3 Java API for XML Registries 1.0 Java Authentication Service Provider Interface for Containers 1.1 Java Authorization Contract for Containers 1.5 Java EE Application Deployment 1.2 (Optional) J2EE Management 1.1 Debugging Support for Other Languages 1.0 Java Architecture for XML Binding 2.2 Java API for XML Processing 1.3 Java Database Connectivity 4.0 Java Management Extensions 2.0 JavaBeans Activation Framework 1.1 Streaming API for XML 1.0 Web Profile? Java EE JSR 342 JSR 356 JSR 353 JSR 340 JSR 344 JSR 341 JSR 245 JSR 52 JSR 352 JSR 236 CDI JSR 346 JSR 330 BV JSR 349 EJB JSR 345 JSR 318 JCA JSR 322 JPA JSR 338 JSR 250 JMS JSR 343 JTA JSR 907 Mail JSR 919 JAX-RS JSR 339 JSR 109 JAX-WS JSR 224 JSR 181 JAX-RPC JSR 101 JSR 67 JAXR JSR 93 JSR 196 JACC JSR 115 JSR 88 JSR 77 JSR 45 JAXB JSR 222 JAXP JSR 206 JDBC JSR 221 JMX JSR 003 JAF JSR 925 StAX JSR 173 JSON-P Servlet JSF EL JSP JSTL Batch             JSF 2.2 CDI 1.1 JPA 2.1     JAX-RS 2.0  4
  • 5. JavaServer Faces 2.2 Big Ticket Features Faces Flows Resource Library Contracts HTML 5 Friendly Markup Stateless Views Several minor enhancements What's new in Java EE 7? 5
  • 6. JSF 2.2: Faces Flows Combination of various views Internal navigation Dedicated entry and return views "Subroutine" Embeddable Flow scoped values and beans What's new in Java EE 7? 6
  • 7. JSF 2.2: Faces Flows Various flow definitions Simple, directory-based Flow descriptor CDI Producer Location Web app root Library JAR META-INF/flows What's new in Java EE 7? 7
  • 8. JSF 2.2: Resource Library Contracts Encapsulation of templates, images, CSS, JS Subdirectory of WebappRoot/contracts Library JAR META-INF/contracts What's new in Java EE 7? 8
  • 9. JSF 2.2: Resource Library Contracts Activation f:view <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" …> <f:view contracts="default"> faces-config.xml <faces-config version="2.2" …> <application> <resource-library-contracts> <contract-mapping> <url-pattern>*</url-pattern> <contracts>jugbb</contracts> </contract-mapping> </resource-library-contracts> What's new in Java EE 7? 9
  • 10. JSF 2.2: HTML 5 Friendly Markup Passthrough elements: Use HTML 5 tags with JSF attributes <input jsf:id="email" jsf:value="#{demoModel.email}“ type="email" name="email" size="40" required="required"/> Passthrough attributes: Use JSF tags with HTML 5 attributes <h:inputText id="nights" value="#{demoModel.nights}" > <f:passThroughAttribute name="type" value="number" /> <f:passThroughAttribute name="size" value="40" /> </h:inputText> What's new in Java EE 7? 10
  • 11. JSF 2.2: More Changes Stateless Views <f:view transient="true"> UIData supports Collection @ViewScoped javax.faces.bean deprecated in next version (@ManagedBean etc.) What's new in Java EE 7? 11
  • 12. Java Persistence API 2.1 Converter JPQL & Criteria Query Enhancements CDI Injection in Entity Listener DDL Handling Entity Graphs What's new in Java EE 7? 12
  • 13. JPA 2.1: Converter @Convert Explicit type / value mapping replaces „User Types“ etc. generalizes @Enumerated, @Temporal @Entity public class Country { @Convert(converter = YesNoConverter.class) private boolean expired; What's new in Java EE 7? 13
  • 14. JPA 2.1: Converter @Converter declares converter can be auto-applied (autoApply = true) @Converter public class YesNoConverter implements AttributeConverter<Boolean, String> { public String convertToDatabaseColumn(Boolean fieldValue) { if (fieldValue == null) return null; return fieldValue ? "Y" : "N"; } public Boolean convertToEntityAttribute(String columnValue) { if (columnValue == null) return null; return columnValue.equals("Y"); What's new in Java EE 7? 14
  • 15. JPA 2.1: JPQL & Criteria Query Enhancements ON: Join filter select p.name, count(b) from Publisher p left join p.books b on b.bookType = BookType.PAPERBACK group by p.name TREAT: Downcast (includes filter) select s from StorageLocation s where treat(s.product as Book).bookType = BookType.HARDCOVER FUNCTION: Call DB function select c from Customer c where function('hasGoodCredit', c.balance, c.creditLimit) What's new in Java EE 7? 15
  • 16. JPA 2.1: JPQL & Criteria Query Enhancements Bulk Update/Delete for Criteria Query CriteriaUpdate<Product> criteriaUpdate = criteriaBuilder.createCriteriaUpdate(Product.class); Root<Product> p = criteriaUpdate.from(Product.class); Path<Number> price = p.get(Product_.price); criteriaUpdate.set(price, criteriaBuilder.prod(price, 1.03)); entityManager.createQuery(criteriaUpdate).executeUpdate(); Stored Procedure Queries StoredProcedureQuery query = entityManager.createStoredProcedureQuery("findMissingProducts"); What's new in Java EE 7? 16
  • 17. JPA 2.1: CDI Injection in Entity Listener public class CountryListener { @Inject private AuditService auditService; @PreUpdate public void preUpdate(Object entity) { this.auditService.logUpdate(entity); } @Entity @EntityListeners(CountryListener.class) public class Country { What's new in Java EE 7? 17
  • 18. JPA 2.1: DDL Handling Create and/or drop db tables Based on entity meta data (mapping) SQL script Data load script <persistence … > <persistence-unit name="test"> … <properties> <property name="javax.persistence.schema-generation.database.action" value="drop-and-create" /> <property name="javax.persistence.schema-generation.create-script-source" value="META-INF/create.sql" /> <property name="javax.persistence.schema-generation.create-source" value="metadata-then-script" /> <property name="javax.persistence.sql-load-script-source" value="META-INF/sqlLoad.sql" /> What's new in Java EE 7? 18
  • 19. JPA 2.1: DDL Handling Write create and/or drop scripts Writer createWriter = …; // File, String … Map<String, Object> properties = new HashMap<>(); properties.put("javax.persistence.schema-generation.scripts.action", "create"); properties.put("javax.persistence.schema-generation.scripts.create-target", createWriter); Persistence.generateSchema("test", properties); What's new in Java EE 7? 19
  • 20. JPA 2.1: Entity Graphs Declaration of lazy attributes to be loaded @Entity @NamedEntityGraph(name = "Publisher_books", attributeNodes = @NamedAttributeNode(value = "books"))) public class Publisher { … @OneToMany(mappedBy = "publisher", fetch = FetchType.LAZY) private List<Book> books; find parameter or query hint fetchgraph: Fetch entity graph attributes only loadgraph: Fetch eager attributes also TypedQuery<Publisher> query = entityManager.createQuery(…); query.setHint("javax.persistence.fetchgraph", "Publisher_books"); What's new in Java EE 7? 20
  • 21. CDI 1.1 Enhanced bean discovery Global enablement of interceptors, decorators, alternatives Constructor interception Transaction support Validation for parameters and return values What's new in Java EE 7? 21
  • 22. CDI 1.1: Bean Discovery Discovery mode: all, annotated, none Exclusion filter: Class or package <beans … bean-discovery-mode="all" version="1.1"> <scan> <exclude name="de.gedoplan.….sub1.beans.DiscoverableBean12"/> <exclude name="de.gedoplan.….sub1.beans.excluded.**"/> <exclude name="de.gedoplan.….dummy.**"> <if-system-property name="NO_DUMMY" value="true" /> </exclude> </scan> </beans> What's new in Java EE 7? 22
  • 23. CDI 1.1: Global Enablement of Interceptors etc. @Priority Interceptors & decorators global enablement Order @TraceCall @Interceptor @Priority(Interceptor.Priority.APPLICATION + 1) public class TraceCallInterceptor { Alternatives Global activation of alternative with highest priority What's new in Java EE 7? 23
  • 24. CDI 1.1: Constructor Interception @TraceCall @Interceptor @Priority(…) public class TraceCallInterceptor { @AroundConstruct public Object traceConstructorCall(InvocationContext ic) throws Exception { … } @AroundInvoke public Object traceMethodCall(InvocationContext ic) throws Exception { … } What's new in Java EE 7? 24
  • 25. CDI 1.1: Transaction Support Platform global transaction interceptor @Transactional TX modes like EJB TX attributes @Transactional(value = TxType.REQUIRED, dontRollbackOn={HarmlessException.class}) public void insert(Cocktail cocktail) { CDI scope @TransactionScoped What's new in Java EE 7? 25
  • 26. CDI 1.1: Bean Validation for Parameters and Return Values @NotNull public List<Questionnaire> createPoll(@Min(10) int { What's new in Java EE 7? size) 26
  • 27. Restful Webservices (JAX-RS) Out-of-the-Box JSON Support @Path("country") @Produces(MediaType.APPLICATION_JSON) public class CountryResource { @GET public List<Country> getAll() { … Client API Client client = ClientBuilder.newClient(); WebTarget target = client.target(“http://.../country/DE"); Country country = target.request(MediaType.APPLICATION_XML) .get(Country.class); What's new in Java EE 7? 27
  • 28. More new things Websockets Concurrency Utilities Batch JMS What's new in Java EE 7? 28
  • 29. Platforms GlassFish 4 Reference implementation Stable version: 4.0 Promoted build: 4.0.1 b03 WildFly 8 Formerly known as JBoss AS Current version: 8.0.0.Beta1 What's new in Java EE 7? 29
  • 30. Links Sample Project https://github.com/dirkweil/whatsNewInJavaEe7 Java EE Blog http://javaeeblog.wordpress.com/ Consulting http://www.gedoplan.de dirk.weil@gedoplan.de Training http://www.ips-it-schulungen.de/ What's new in Java EE 7? 30
  • 31. Schön, dass Sie da waren! dirk.weil@gedoplan.de