Wednesday Nov 02, 2011

Migrating Spring to Java EE 6 Article Series


Java EE 6 with its light-weight, easy-to-use, and simplified yet powerful functionality is very compelling. This is the only standards-based enterprise Java platform supported by multiple vendors including, but not limited to, Oracle, IBM, Apache, Caucho, and others.

To highlight some advantages of the Java EE 6 platform (and brush up some ;-) ...

How do you write an EJB ?

@Stateless
public class MyEJB {
    public doTransaction() {
        . . .
    }
}

And package it in a WAR, no deployment descriptor or special packaging. Don't keep blowing the J2EE 1.3/1.4 horn guys!

How do you inject a bean or multiple implementations of service in another class ?
@Inject [@SomeQualifier] MyEJB
Yes, Contexts and Dependency Injection provide lot more rich functionality in the platform.

How do you schedule a timed task ? - Just add
@Schedule
on a public method of an EJB>

How do you expose a POJO as a RESTful entity ?

@Path
public class MyResource {
    @GET
@Produces("application/xml")
    public String myGet() {
        . . .
    }
}
JSF 2 now uses Facelets-based templating language, allow composite components to be written very easily, truly enforce MVC-based pattern, and lot more benefits.

What does a Servlet look like ?

@WebServlet
public class MyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response) {
        . . .
    }
}

And no "web.xml" here as well.

With a wide variety of development (NetBeans, Eclipse, IntelliJ) and deployment options (GlassFish, JBoss, Caucho, TomEE, ...) and no vendor lock-in, Java EE 6 is the only platform you need to build your enterprise applications. Read more benefits of the platform by the actual users here.

With all these benefits of Java EE 6, here is a very timely multi-part article by David Heffelfinger showing how to migrate your applications from Spring -> Java EE 6. Don't wait, you can deploy Java EE 6 applications on GlassFish (along with commercial support from Oracle) today!

Part 1 is now available.

Let us know what you think!
About

profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.


Java EE 7 Samples

Stay Connected

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today