我是 Struts2 新手。当我编辑 web.xml
<filter>
<filter-name>struts2></filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
我收到错误:本地主机上的服务器 Tomcat v8.0 服务器无法启动。
我该怎么办?
最佳答案
您应该检查您在 <filter-class>
中编写的类是否存在于类路径中,即与应用程序一起部署的 jar 之一中。
了解 web.xml
用于Struts2应用程序。如果您使用的是 Struts 2.5.x,则该类应该是
<小时/><filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
关于java - 使用Struts 2时如何配置web.xml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42613132/