IntelliJ IDEA编辑器显示web.xml红叉,内容如下
The content of element type “web-app” must match “(icon ,display-
name ,description ,distributable ,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-
mapping*,session-config ,mime-mapping*,welcome-file-list ,error-page*,taglib*,resource-env-
ref*,resource-ref*,security-constraint*,login-config ,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)”.
- No grammar constraints (DTD or XML schema) detected for the document.
出错原因是web.xml
标签顺序有问题,比如下面的顺序就是正确的:
<!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>
<display-name>Agreport</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:ureport-console-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>ureportServlet</servlet-name>
<servlet-class>com.bstek.ureport.console.UReportServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ureportServlet</servlet-name>
<url-pattern>/ureport/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
而下面的顺序就会提示红叉:
<!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>
<display-name>Agreport</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:ureport-console-context.xml</param-value>
</context-param>
<servlet>
<servlet-name>ureportServlet</servlet-name>
<servlet-class>com.bstek.ureport.console.UReportServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ureportServlet</servlet-name>
<url-pattern>/ureport/*</url-pattern>
</servlet-mapping>
<!--调正顺序-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
最新评论
我的是ipv4网络,如何使用直播源啊!
我今天试了,不想啊,我的是新疆昌吉移动的网络。
收不到验证码电报
现在充值29起了