@WebListener 为什么不起作用
时间:2015-03-12 13:28:07
收藏:0
阅读:1507
@WebListener 是servlet3.0后的新特性,需要在web.xml中配置,如下:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0"
metadata-complete="false">
重点是metadata-complete="false",不要问我为什么,去看servlet3.0规范去。。
原文:http://my.oschina.net/doctor2014/blog/385929
评论(0)