web.xml inspection - "<servlet-name>*</servlet-name>" is *not* an error

Servlets spec 2.5 allows to specify <servlet-name></servlet-name>* inside <filter-mapping> (http://www.javaworld.com/javaworld/jw-01-2006/jw-0102-servlet.html , couldn't download the spec itself from Sun's site). IDEA highlights '*' with red and says "Cannot resolve Servlet *".

Currently, "Web.xml errors inspection" provides no way to ignore <servlet-name>*</servlet-name> patterns

13 comments
Comment actions Permalink

Grrr .. Tomcat-6.0.13 doesn't support it. Jetty-6.1.5 does, though ..

0
Comment actions Permalink

Neither does Tomcat 6.0.14 but this time it doesn't even display an error message (6.0.13 was throwing java.lang.IllegalArgumentException: Filter mapping must specify either a <url-pattern> or a <servlet-name>)

Sorryo for offtopic - just thought is might be useful to somebody

0
Comment actions Permalink

Could you file a JIRA request for this?


0
Comment actions Permalink

Currently, "Web.xml errors inspection" provides no way to ignore <servlet-name>*</servlet-name> patterns

Suppress for tag?

0
Comment actions Permalink

I'm sorry, Peter, what do you mean by that ? Looking at "Web.xml errors" inspection I see it contain no configuration options (image attached)



Attachment(s):
1.png
0
Comment actions Permalink

I'm sorry, Peter, what do you mean by that ? Looking at "Web.xml errors" inspection I see it contain no configuration options (image attached)

Just like you suppress any inspection in java. Put the caret onto the
error, a light bulb appears, click it (or Alt+Enter), press right arrow,
you'll see various suppress actions.

0
Comment actions Permalink

Ah, nice, never used it, thank you !

0
Comment actions Permalink

Hi,

There's another issue with Servlet 2.5 support - multiply <url-pattern> in servlet or filter mapping is now allowed. But "Assembly Descriptor" view of web.xml only displays the first one, see the images attached.

Do you want me to file JIRA for this issue as well ?

P.S.
Btw, I already see how "*" for servlet name in filter mapping is fixed in build 7255 - thanks !



Attachment(s):
1.PNG
2.PNG
0
Comment actions Permalink

And, for those who're interested, it's not supported in JBoss v4.2.0.GA :(

Failed to parse WEB-INF/web.xml; - nested throwable: (org.jboss.deployment.DeploymentException: expected only one url-pattern tag)

0
Comment actions Permalink

So it appears Jetty is the only who's implemented Servlet 2.5 spec correctly (when talking about web.xml changes). Didn't try Geronimo or Glassfish though

0
Comment actions Permalink

Do you want me to file JIRA for this issue as well ?

Please do this.

0

Please sign in to leave a comment.