![](/img/trans.png)
[英]web.xml error in SOAP web service using intellij and Tomcat
[英]Error in web.xml in tomcat v.7.0.61
我在server-url标记附近的web.xml中收到以下错误。 以下是web.xml
cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-url'. One of '{"http://java.sun.com/xml/ns/javaee":url-pattern}' is
expected.
以下是发生错误的servlet映射标记
<servlet-mapping>
<servlet-name>appcontroller</servlet-name>
<servlet-url>/appcontroller</servlet-url>
</servlet-mapping>
我该如何解决?
尝试
<servlet-mapping>
<servlet-name>appcontroller</servlet-name>
<url-pattern>/appcontroller</url-pattern>
</servlet-mapping>
将代码替换为:
<servlet-mapping>
<servlet-name>appcontroller</servlet-name>
<url-pattern>/appcontroller</url-pattern>
</servlet-mapping>
cvc-complex-type.2.4.a: Invalid content was found starting with element 'servlet-url'. One of '{"http://java.sun.com/xml/ns/javaee":url-pattern}' is expected.
您的web.xml格式错误。 您必须将标签<servlet-url>
更改为<url-pattern>
有关包含文档的示例,请查看以下内容:
https://tomcat.apache.org/tomcat-7.0-doc/default-servlet.html
这是DefaultServlet的web.xml,可用于提供诸如html,js,图像之类的静态内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.