Search This Blog

2009-12-19

Java EE 6 - The WebProfile

Hi guys,

Within the next few weeks/months I will write about the new Java EE6 components.
The first new feature I am focussing on is the so called WebProfile.
The Web Profile is targeted at developers of modern web applications.
Within the last years developing web applications has become more and more important. However, there has also been a large number of technologies for the creation of web applications. All of them had to face similar challenges, like security handling, persitence or transaction handling. The WebProfile aims at defining a basic stack for developing web applications using the Java platform.

The following technologies are required components of the Web Profile:
•Servlet 3.0
•JavaServer Pages (JSP) 2.2
•Expression Language (EL) 2.2
•Debugging Support for Other Languages (JSR-45) 1.0
•Standard Tag Library for JavaServer Pages (JSTL) 1.2
•JavaServer Faces (JSF) 2.0
•Common Annotations for Java Platform (JSR-250) 1.1
•Enterprise JavaBeans (EJB) 3.1 Lite
•Java Transaction API (JTA) 1.1
•Java Persistence API (JPA) 2.0
•Context and Dependency Injection (JSR-299)

The maven repository offers the following jar for the WebProfile
(see maven repository url).
Include it into your pom like this:

<repositories>
<repository>
<id>java.net2</id>
<name>Repository hosting the jee6 artifacts</name>
<url>http://download.java.net/maven/2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

If you chose Netbeans 6.8 as your development environment you can create a maven built web project. In the project properties within the run menu you can switch between the different profiles (full and web).

After switching you see the difference in the libraries (the full profile uses the javaee-api-6.0.jar).

The Java EE6 reference implementation Glassfish V3, based on OSGI, allows the dynamic addition of new functionality both from Sun and third parties. Glassfish V3 offers both the Full JavaEE profile and the new WebProfile.
Based on internal Sun benchmarks, Sun GlassFish Enterprise Server v3 startup times are over twice as fast as v2 and in the case of the Web Profile offering, nearly three times faster.
The following glassfish page gives you a perfect overview between what is included in the Web Profile and in the Full Java EE Profile.


I really love the new WebProfile. Not only because of the performance boost, but also because of the simplified packaging (No EAR packaging needed anymore). So if you don't depend on JMS or remote EJBs, the new WebProfile is what you were looking for as a web developer. Give it a try.

No comments:

Post a Comment