【发布时间】:2012-12-07 15:41:56
【问题描述】:
我刚刚发现了 Struts2,但 web.xml 文件有问题。
过滤器标签附近出现错误:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
错误说:在这一行发现了多个注释:
- 元素的开始标签<filter>
- 根元素之后的文档中的标记必须是正确的 -
形成。
有什么问题?我该如何解决?
谢谢!
感谢 Aleksander 的关注:
这是我的web.xml 文件:
`<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>struts2example</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>`
【问题讨论】:
-
显示整个
web.xml文件。 -
感谢 Aleksandr M,这是我的整个
web.xml文件
标签: xml struts2 filter markup well-formed