servlet3.X中的metadata-complete属性

来源:互联网 发布:八维研修学院java课程 编辑:程序博客网 时间:2024/05/21 09:55

http://www.copperykeenclaws.com/tomcat-and-servlet-3-0-web-configuration/

在Servlet3.X的web.xml中可以设置metadata-complete属性,例如:

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee                      http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"         version="3.1"         metadata-complete="true"></web-app>

如果设置metadata-complete="true",会在启动时不扫描注解(annotation)。如果不扫描注解的话,用注解进行的配置就无法生效,例如:@WebServlet

0 0
原创粉丝点击