This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 310163 - No web.xml created by default for Web 2.5 projects
Summary: No web.xml created by default for Web 2.5 projects
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Vista
: P3 major (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Carl Anderson CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on: 311729
Blocks:
  Show dependency tree
 
Reported: 2010-04-22 13:20 EDT by Kaloyan Raev CLA
Modified: 2010-05-13 23:13 EDT (History)
2 users (show)

See Also:
ccc: pmc_approved? (david_williams)
ccc: pmc_approved? (raghunathan.srinivasan)
ccc: pmc_approved? (naci.dai)
ccc: pmc_approved? (deboer)
neil.hauge: pmc_approved+
ccc: pmc_approved? (kaloyan)
cbridgha: review+


Attachments
Set the default to true (1.24 KB, patch)
2010-05-11 10:43 EDT, Carl Anderson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kaloyan Raev CLA 2010-04-22 13:20:16 EDT
Steps to reproduce:
1. Invoke the New Dynamic Web Project wizard.
2. Enter some Project name. 
3. Choose '2.5' for Dynamic web module version. 
4. Click Next twice. 

The 'Generate web.xml deployment descriptor' checkbox is unchecked. It should be only unchecked for version 3.0 and still checked for 2.5. In Galileo we had the checkbox checked for 2.5 by default. 

While it is still valid to have no web.xml for Web 2.5 projects, the problem gets bigger when you try to create new Servlet. After executing the New Servlet wizard, a web.xml file is generated, but the necessary servlet tags are not registered there.
Comment 1 Carl Anderson CLA 2010-05-11 09:27:47 EDT
We now have separate preferences for Web 2.5 and Web 3.0 defaults.  (See bug 311729)
Comment 2 Carl Anderson CLA 2010-05-11 10:43:03 EDT
Created attachment 167932 [details]
Set the default to true
Comment 3 Carl Anderson CLA 2010-05-11 10:43:25 EDT
Unfortunately, in bug 311729, the decision was made to not turn on the Web 2.5 deployment descriptor generation by default.

This is a serious issue in WTP- not any adopter.  We changed this setting from WTP 3.1.x to WTP 3.2 because we made our wizards and operations smart enough to generate the deployment descriptor if necessary.  However, our merged model still has problems with the first servlet/filter/listener that is created.
Comment 4 Chuck Bridgham CLA 2010-05-11 11:46:32 EDT
approve
Comment 5 Carl Anderson CLA 2010-05-11 16:55:40 EDT
This bug results in the loss of the first servlet/filter/listener that is created in a Web 2.5 project- the class files remain, but the entry in the deployment descriptor is not generated and thus it is useless.

The workaround is to generate the deployment descriptor for a Web 2.5 project before adding any servlets/listeners/filters.  That is exceedingly error-prone.

This fix has been tested by hand to guarantee that the deployment descriptor is created by default.

Chuck Bridgham has reviewed this fix.

The risk is minimal, and only in relation to the creation of a deployment descriptor upon creation of a Web 2.5 project.
Comment 6 Carl Anderson CLA 2010-05-12 11:52:27 EDT
Committed to HEAD for WTP 3.2 RC1