Petr has posted 1 posts at DZone. View Full User Profile

Java EE 6 in NetBeans IDE 6.8 Milestone 1

08.07.2009
| 20946 views |
  • submit to reddit
The first of a series of articles from the NetBeans Java EE team. In this case, the article is by Java EE team manager Petr Jiricka.

You may know that the next iteration of the Java Enterprise Edition, i.e. Java EE 6, is nearing completion. Many key  specifications, including Java Persistence 2.0, JavaServer Faces 2.0 and EJB 3.1 are now in the Proposed Final Draft phase. In version 6.8 Milestone 1, NetBeans is now adding support for the Java EE 6 platform.

This entry is not meant to be a general introduction to Java EE 6—for a basic overview, see e.g. this introductory article by Reza Rahman. Rather, we will focus directly on the EE 6 support in NetBeans area by area.

Creating Java EE 6 applications

The first change you will notice is that NetBeans now uses GlassFish v3 promoted builds as the built-in server, which supports EE 6 out of the box. Accordingly, when creating one of the Java EE projects (Web, EJB, AppClient or EAR project), 'Java EE 6' is now available as a choice in the New Project wizard.

This is the only time you are required to specify a Java EE version: after that, NetBeans automatically figures out what versions of the sub-specifications to use based on what your server supports, what is your Java EE version etc. This has a nice side effect—if you use a server that only supports Java EE 5, such as GlassFish v2.1, you can still use some of the Java EE 6 technologies. For example, JSF 2.0 can be used with Java EE 5 projects, as well as JAX-RS (Java API for RESTful Web Services) 1.0, and NetBeans enables you to do just that.

JavaServer Faces 2.0

The big changes in the JSF area include the usage of Facelets as the default page language, and usage of annotations instead of XML configuration. Facelets was a successful technology even before JSF 2.0, and for a long time NetBeans has provided support for pre-EE 6 Facelets through the nbfacelets module. In NetBeans 6.8 M1, this module is included directly, so facelets format is supported out of the box, as you can see in the screenshot below.



Java Persistence 2.0

NetBeans 6.8 Milestone 1 now allows you to take advantage of the new features in JPA 2.0, such as the Criteria API or integration with the Bean Validation specification. When using JPA in Java EE 6 projecs in NetBeans, these new APIs are available out of the box.

Enterprise JavaBeans 3.1

The most expected feature of EJB 3.1 is the ability to use EJBs in ordinary web modules. This is a major simplification of the build/packaging/deployment process—instead of an EAR file with two submodules (web and EJBs), many applications will now need just one WAR file. Indeed, NetBeans makes it possible to build such applications: wizards for creating EJBs are available in ordinary web projects, and you now see them in the project explorer, as shown on the screenshot below.

This picture shows one other interesting feature—the support in RESTful web services, which you can also create in web projects.

Servlet 3.0

Servlet 3.0 specification defines annotations that can be used in place of XML configuration. For example, when creating a servlet in NetBeans, XML configuration in web.xml is by default not created—rather, annotations on the servlet define its deployment properties. One nice sideeffect of this is that many web applications will not need web.xml at all—one less XML file to worry about. And as you might expect, when you create a web project in NetBeans 6.8 M1, it does not have web.xml by default.

And there is much more

While JPA 2.0, JSF 2.0, EJB 3.1, Servlet 3.0 and JAX-RS 1.0 are probably the most notable and important improvements in Java EE 6 compared to the previous version of the platform, the changes that support EE 6 development in NetBeans 6.8 do not end here. Other notable differences in NetBeans 6.8 M1 include:

  • NetBeans 6.8 M1 now includes the complete Javadoc for the Java EE 6 platform.
  • NetBeans now bundles the new libraries from the Java EE 6 platform, including the latest builds of EclipseLink 2.0, JSF 2.0, the Metro web services stack etc.
  • New versions of all the deployment descriptor are supported in the graphical and text editors

For a complete description of Java EE 6 features in NetBeans 6.8 Milestone 1, see the New and Noteworthy page.

This article is the first in a series of articles about Java EE in NetBeans—in the future, we plan to regularly publish articles about Java Web and EE development in NetBeans. Such entries will be tagged with 'JavaEE', so you can bookmark this link to get to them directly.  

Further information

 To find out more about Java EE 6 and NetBeans, you can also explore the following resources:

AttachmentSize
facelets_editing.png130.96 KB
ejb_node.png27.91 KB
Published at DZone with permission of its author, Petr Jiricka.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Ryan Developer replied on Thu, 2009/08/20 - 11:03pm

Can you please comment on the extent of JSR 299 support we will see in NetBeans 6.8? I noticed in the wiki that a bunch of the planned features for JSR 299 support will be dropped.

Petr Jiricka replied on Tue, 2009/09/15 - 6:08am

Hi Ryan, JSR 299 is still being finalized and it's changing rapidly, so supporting it well in NetBeans 6.8 is a bit of a challenge. We are doing what we can, but it's true that many subfeatures in this area are being dropped.

Matt Coleman replied on Wed, 2012/03/21 - 12:38pm in response to: Petr Jiricka

 any updated version for 2012?

 

web designer buffalo
 

Bryan Low replied on Fri, 2013/02/01 - 10:32pm

Twin Fountains EC is a 99-years leasehold Woodlands EC development located at Woodlands Drive 16 in District 25. With expected completion in mid 2016, it comprises of 8 towers with 418 units and stands 14 storeys tall.

http://twin-fountains.org

Stanciu Marius replied on Thu, 2013/04/18 - 2:50pm

 it comprises of 8 towers with 418 units and stands 14 storeys tall.

drpciv

Bryan Low replied on Tue, 2013/06/04 - 12:58am

Future residents will be able to walk to the existing Bugis MRT. With such a short drive to the city area as well as the orchard and bugis area, entertainment for your love ones and family will come at a stone’s throw away. DUO

Bryan Low replied on Mon, 2013/06/17 - 1:07am

Lush Acres EC is a 99-years leasehold Punggol EC development located Sengkang West Way / Fernvale Link in District 19. With expected completion in mid 2016, it comprises of TBA towers with TBA units and stands TBA storeys tall. It is situated right beside Kupang LRT Station. Sengkang EC

Pop Madalina replied on Thu, 2013/08/22 - 4:50am in response to: Bryan Low

I like read  about Java EE 6 and NetBeans.I got really an informative stuff and great books information.i will visit here again thanks for sharing. How To Tie A Tie 

Desmond Tan replied on Wed, 2013/09/11 - 10:29pm

Flora Drive Condo is a new and upcoming Flora Road New Launch Condo located in Flora Road, within a short drive to Singapore Expo, Tampines Point, Century Square and IKEA. With expected completion in mid 2017, it comprises of TBA towers with TBA units and stands TBA storeys tall. Flora Drive Condo

Bryan Skyvue replied on Sun, 2013/09/15 - 1:34am

For vehicle owners, Sky Vue Condo takes less than 15 minutes to drive to the business hub and vibrant Orchard Road shopping district, via Central Expressway (CTE). Skyvue

Pop Madalina replied on Sun, 2013/09/15 - 8:38am

Congratulations for the first in a series of articles about Java EE in NetBeans, expect these items. Good luck!
maid service Chicago

Bryan Skyvue replied on Wed, 2013/09/25 - 6:53am

Jurong West EC is also near elite schools such Yuvabharathi International School, Hua Yi Secondary School and St. Anthony's Primary School. Jurong West EC

Jurongwestcondo... replied on Tue, 2013/10/08 - 11:05pm

New Condo in Jurong is also near elite schools such as Canadian International School, Yuvabharathi International School, Hua Yi Secondary School and St. Anthony's Primary School. jurong west street 41 condo pricing

Pop Renata replied on Sun, 2014/03/02 - 9:22am in response to: Bryan Low

 Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.iphone 5c cases

Pop Madalina replied on Thu, 2014/03/27 - 6:08pm

 *This really answered my problem, thank you! udemy coupon code free

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.