您的位置:首页 > 其它

web.xml 过滤器配置

2015-01-19 14:33 302 查看
<filter>
<filter-name>Filter的名字</filter-name>
<filter-class>Fliter类的名称(过滤类完整的名字包括包名)</filter-class>
<init-param> <!--初始化参数,可以是多对 -->
<description>描述信息,可省略</description>
<param-name>参数名称</param-name>
<param-value>参数值</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Filter的名字</filter-name>
<url-pattern>用户请求的url,和指定的url匹配是触发的过滤工作</url-pattern>
<despacher>默认是request(还包括include、forword、error)</despacher>
</filter-mapping>

配置错误页面的过滤器
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: