配置 web.xml

修改src/main/webapp/WEB-INF/web.xml文件:

如果是使用archetype创建的工程可以跳过此章节。

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

    <display-name>Hello API</display-name>

    <filter>
        <filter-name>app-filter</filter-name>
        <filter-class>leap.web.AppFilter</filter-class>
    </filter>

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

</web-app>
上一篇:配置 pom.xml 下一篇:配置 config.xml

results matching ""

    No results matching ""