[hr] Bug 177582 - Add Framework action removes the content of web.xml
David Konecny <[email protected]>
| Newsgroups | gmane.comp.java.netbeans.reviewers |
|---|---|
| Message-ID | <[email protected]> |
https://netbeans.org/bugzilla/show_bug.cgi?id=177582 Problem: Adding a web framework to Web Project overwrites existing web.xml with a new empty one and user loses whatever was previously there. Cause: since Java EE 6 web.xml is optional but most of the existing frameworks require it and web.xml has to be created if it does not exist. There is error in current code which creates web.xml always regardless if it already exists or not. Fix: trivial - skip web.xml creation if it already exists. To prevent similar issues in future I enhanced semi-API method which creates web.xml to check file's existence and throw IllegalStateException in case it does. Change was reviewed and is going to be tested today. I'm not sure whether there is time to include it in RC1, but if there are no objections it can be perhaps integrated to RC2. Thanks, -David