我只是發現Struts2,並且我在web.xml
文件中遇到問題。Struts2:在根目錄下的文檔中的標記必須是格式良好的
它給我的過濾器標籤附近的錯誤:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
錯誤說:這條線找到多個註釋: - 開始元素<filter>
的標籤 - 文檔中的標記的根元素以下必須很好 - 組成。
什麼問題?我該如何解決它?
謝謝!
感謝亞歷山大對你的興趣:
這裏是我的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'文件 – user1885868