History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEA-17132
Type: New Feature New Feature
Status: Open Open
Assignee: Dmitry Avdeev
Reporter: Stephen Beitzel
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Feedback

Obvious web.xml problems ought to be fixable via intention

Created: 13 Feb 08 02:59   Updated: 13 Feb 08 13:18
Component/s: Editor. Intention Actions, Code Analysis. Inspection, J2EE.Web

Environment: Windows XP Pro

Build: 7,590
Severity: Low


 Description  « Hide
IDEA can validate a web.xml file and it will highlight in red and halt the make if the file doesn't validate. However, for some validation problems the fix is straightforward and it would be nice if the editor could at least tell the user what the fix is, or offer to perform the fix automatically.

For example, this snippet of a web.xml will NOT validate because all the <servlet> elements have to come together; they are not allowed to be mixed up with the <servlet-mapping> elements:

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
...
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
...
</web-app>

The editor will highlight the <web-app> tag, though, not the <servlet> or <servlet-mapping> tags (servlet-mapping elements must come after all the servlet elements).

Things that ought to be true:
1) the out-of-place tags ought to be highlighted
2) although the validation failed because the contents of the web-app element are out of order, the error message ought to say what elements are incorrect
3) since the otherwise fine web.xml would validate if the elements were just in the right order, there ought to be an intention to reorder the elements according to the DTD

This becomes more helpful as web.xml grows. I'm a contributor to a web app whose web.xml is over six thousand lines long.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.