views:

9

answers:

1

I am using Eclipse Helios Release. Eclipse xml validater don't like display-name element under in my web.xml

here is part of my web.xml

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">

PropTax PropTax
PropTax org.slco.treasurer.propertytax.servlet.PropTax .......

If I remove display-name element then there is no error anymore.
As I understand 2.5 is right sechema to support display-name, and even context help under the editor will list display-name as part of chioce.

Could anyone help me here?

error message from eclipse validator as: cvc-complex-type.2.4.a: Invalid content was found starting with element 'display-name'. One of '{"http://java.sun.com/xml/ns/javaee":servlet-class, "http://java.sun.com/xml/ns/javaee":jsp-file}' is expected. web.xml /PropTax/WebContent/WEB-INF line 6 XML Problem

Thanks!

A: 

You need to use the '101010' button to quote your XML for it to be readable.

However, according to the XSD you referenced, a servlet definition (servlet tag) needs to have the description stuff (including display-name) before the servlet-name. Given the error you've posted, I suspect you've got servlet-name followed by display-name. However, it's hard to tell without seeing the XML well formatted.

dty
Thanks for your help. I got it work by adding description element.
juny fan
Don't forget to accept my answer.
dty