Relevant changes:

  • web.xml is optional and annotations can be used instead

Open issues:

  • even if project is JEE6 some users may prefer to use web.xml instead of annotations, for example when creating new Servlet, ServletListener, etc. For now I would recommend to not make this configurable in wizards and always generate annotations. It can be revisited if there is enough demand for it.


  • M1 - enhances metadata model to merge deployment information
  • M2 - does everything else (update wizards to use annotations, new wizards for web-fragments, etc.)


  • S.1 STARTED (P1, PetrS, M1, 2-4W) create new (annotation based) deployment descriptor model (similarly as was done for EJB's deployment descriptor in JEE5). properly merge annotations and web.xml and web-fragment.xml according to rules defined by the spec; metamodel has to be updatable and changes should be stored to web.xml
  • S.2 DONE (P2, PetrS, M1, 1-5D) change web project to not generate web.xml at all; if this become source of problems then always generate empty web.xml; add WebFrameworkProvider.requiresWebXml() (for backward compatibility returning by default true) and if framework being added to a project returns true then generate empty web.xml if it does not exist yet (iff project is JEE6 project)
  • S.3 DONE (P2, PetrS, M1, 1-5D) update wizards to use annotations instead of updating web.xml (New Servlet, Listener, etc.) (iff project is JEE6 project)
  • S.4 DONE (P2, PetrS, M1, 1-3D) add new wizards for creation of web-fragment.xml and web.xml in Web Project (iff project is JEE6 project)
  • S.5 DONE (P2, PetrS, M1, 1D) amend web.xml GUI editor to operate on metadata model created just for web.xml; if this is too complicated then web.xml GUI editor could be permanently disabled
  • S.6 (P2-3, PetrS, M2, 1-5D) support editting of web-fragment.xml (hints, refactoring, code completion, etc.)
  • S.7 DONE (P2-3, PetrS, M2, 1-3D) list web-fragment.xml (presented in project's sources) under Configuration Files; possibly list also web-fragment.xml files from all modules on classpath (and communicate that these are readonly).
  • S.8 DONE (P3, PetrS, M2) enhance web.xml GUI editor to work also for web-fragment.xml files (web.xml and web-fragment.xml are using different XSD but differences are tiny - download dev build of Glassfish v3 and check folder glassfishv3/glassfish/lib/schemas to compare schemas)


  • S.1 Metadata model clients need to be evaluated and use-cases extracted. Then metamodel may be extended based on requirements.
  • S.2 Still some code may depend on web.xml and should be fixed. I tested New File > {Servlet, Filter, Listener}, and Project > Properties > Frameworks > Add.
  • S.3 For JEE 6 projects, if the checkbox "Add information into DD" is not checked then annotations are generated. The checkbox is unchecked for JEE 6 projects by default.
  • S.5 web-fragment.xml can be edited as XML and in visual editor.
  • S.8 web-fragment.xml can be edited as XML and in visual editor. Support for ordering implemented. (Editing of some of new elements not implemented yet.)

Non-JEE6 Tasks:

  • (P1) lower bug count
  • (P2-3) TaskList integration - implement/enhance/update web deployment descriptor specific editor hints and task list items
  • (P2-3) refactoring - implement/enhance/update refactoring for web deployment descriptor
  • DONE (P2-3) Drop support for J2ee 1.3 and older (mainly from j2ee.dd)

Other tasks currently not planned:

  • UI to overide annotations/web-fragments.xml in web.xml
  • vizualization which section of web.xml are overriding others and corresponding 'GoTo original definition' action

Resources and links:


Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo