我的项目似乎无法识别struts.xml

时间:2017-06-20 02:56:48

标签: java eclipse struts2

/WEB-INF/web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="MyStrutsApp" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

我将struts.xml置于src下并在web.xm l中设置,但我只收到404错误。

enter image description here

0 个答案:

没有答案