servlet-class :cvc-complex-type.2.4.a

 

 

<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <servlet> <servlet-class>com.hjc.Bailang</servlet-class> <servlet-name>langlang</servlet-name> </servlet> <servlet-mapping> <servlet-name>langlang</servlet-name> <url-pattern>/baidaifu</url-pattern> </servlet-mapping> </web-app>  

 

 

<servlet>

<servlet-class>com.hjc.Bailang</servlet-class>

<servlet-name>langlang</servlet-name>

 

</servlet>

这段报错,报错为:

cvc-complex-type.2.4.a: Invalid content was found starting 

 with element 'servlet-class'. One of '{"http://java.sun.com/xml/

 ns/javaee":description, "http://java.sun.com/xml/ns/

 javaee":display-name, "http://java.sun.com/xml/ns/

 javaee":icon, "http://java.sun.com/xml/ns/javaee":servlet-

 name}' is expected.

 

解决办法:

出现原因:位置颠倒

<servlet>

<servlet-name>langlang</servlet-name>

<servlet-class>com.hjc.Bailang</servlet-class>

</servlet>

你可能感兴趣的:(encoding)