This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187548 - Add file template for web-fragment.xml
Summary: Add file template for web-fragment.xml
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-14 14:14 UTC by Erno Mononen
Modified: 2010-06-16 01:28 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erno Mononen 2010-06-14 14:14:39 UTC
Supported in Servlet 3.0.
Comment 1 Vince Kraemer 2010-06-14 14:20:10 UTC
there is a file template for web-fragment.xml... where were looking for it that you did not find it?
Comment 2 Erno Mononen 2010-06-14 19:26:17 UTC
I looked under every category available in the new file wizard in a java ee 6 web app, but I can't find it. Where is it supposed to be?
Comment 3 David Konecny 2010-06-14 23:10:54 UTC
There was discussion long time ago that web-fragment.xml has only sense in J2SE Class Library project, that is in a project in which a web framework or a support web library is being developed. So the template is available only in J2SE class library project (beware: once J2SE project has a main class it is not class library project anymore - it is j2se application project).
Comment 4 Erno Mononen 2010-06-15 07:28:47 UTC
I guess that makes sense; I was thinking that one may want to use web-fragments to modularize web.xml even when the "modules" are not separate libraries but just logical partitions within the web app. That is a theoretic use case though, I ran into this when I was reading the spec and trying out how it works.
Comment 5 David Konecny 2010-06-15 20:21:29 UTC
(In reply to comment #4)
> I was thinking that one may want to use web-fragments
> to modularize web.xml even when the "modules" are not separate libraries but
> just logical partitions within the web app.

I'm pretty sure we had discussed this scenario but I cannot remember why we decided against it and I cannot find the discussion. Vince, do you remember?
Comment 6 Vince Kraemer 2010-06-15 23:45:22 UTC
I think it is disallowed by section 8.2.1 of the spec. Paragraphs 3-5 seem to make the restriction fairly tightly.

The file web-fragment.xml can only appear in the META-INF directory of a jar file. 

Only jar files that are packaged in WEB-INF/lib are scanned for META-INF/web-fragment.xml
Comment 7 David Konecny 2010-06-16 01:28:07 UTC
(In reply to comment #6)
> I think it is disallowed by section 8.2.1 of the spec. Paragraphs 3-5 seem to
> make the restriction fairly tightly.

It is very clear. I feel like it is first time I'm reading it. My fault.

> Only jar files that are packaged in WEB-INF/lib are scanned for
> META-INF/web-fragment.xml

As Vince pointed out this is problem. I filed it as Bug 187624.