Geertjan's Blog

  • September 10, 2009

Java EE 6 and NetBeans IDE 6.8

Geertjan Wielenga
Product Manager
I attended a meeting yesterday about Java EE 6 features in the upcoming NetBeans IDE 6.8.

Some notes:

  • The main emphasis is on the 'Web Application' project type, since EJBs can now also be created within web applications. The thinking is that other web-related project types, for EJB modules, app clients, and Java EE applications will be less used from NetBeans IDE 6.8 onwards.
  • GlassFish v3 is the only server currently supporting Java EE 6. It is based on OSGi and is therefore modular. Therefore, only if this server is selected in the Web Application project wizard, can Java EE 6 be selected from the Spec Version drop-down box.
  • Facelets, which is now part of the Java EE spec, is the default page language if JSF is chosen in the "Frameworks" panel, though "JSP" can also be selected.
  • The Web Application project wizard will create a Facelets template and an XHTML file that references the Facelets template will be the welcome page of the application. (But if there is no web.xml [see below], where will this be set?)
  • The 'New JSF Pages from Entity Classes' wizard will generate Facelets instead of JSP, if Java EE 6 is set as the project's spec version.
  • Facelets file type support in the editor consists of code completion, documentation popup, expression language completion, and expression language source navigation. Tags for all available libraries on the classpath will be available in code completion, then the IDE will add the relevant declaration for the selected library to the top of the file.
  • No web.xml file will be needed anymore, everything that used to be set there can now be set via annotations. Therefore, no web.xml file will be created anymore via the Web Application project wizard.
  • There is a file-level wizard for JSF composite components.
  • EJBs can be created in the web application via the related wizards. This simplifies the build and the packaging of EJBs, since they'll be in the WAR file instead of a separate EAR file.
  • Instead of servlets, Java EE 6 applications are more likely to use RESTful web services. Several powerful file templates are available for these in NetBeans IDE 6.8 (which were also there previously).
  • AJAX support in Java EE 6 is supported in NetBeans IDE 6.8 via code completion (and other editor features) within the Facelets files.
  • It is possible to change a RESTful web service into an EJB, via an annotation, and it is also possible to inject EJBs into a RESTful resource.
  • There's a new possibility of creating a singleton EJB, instead of stateless/stateful.

Other references:


Java EE 6 in NetBeans IDE 6.8 Milestone 1

Join the discussion

Comments ( 5 )
  • jiai Thursday, September 10, 2009

    Currently (4 or 5 days ago), the support of Facelets in the Netbeans nightly builds is really suboptimal: the editor shows lots of errors and warnings, even in the Netbeans generated code.

  • Geertjan Thursday, September 10, 2009

    "really suboptimal" is not an appropriate term to use while a product has not been released yet. In that case, the term is "really under development".

  • hantsy Thursday, September 10, 2009

    There is no plan of the embeded ejb container support for lightweight outside-container test.

  • Alexis MP Wednesday, September 23, 2009

    @hantsy: EJBContainer.getContainer() is a standard API in EJB 3.1 which you can use with glassfish/lib/embedded/glassfish-embedded-static-shell.jar (requires full GlassFish v3 install)

  • Alexis MP Wednesday, September 23, 2009

    err, make that EJBContainer.createEJBContainer()

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.