zoukankan      html  css  js  c++  java
  • web.xml在Servlet3.0中的新增元素

    metadata-complete:

    当属性为true时,该Web应用将不会加载注解配置的Web组件(如Servlet、Filter、Listener)

    当属性为false时,将加载注解配置的Web组件(如Servlet、Filter、Listener).

    注意:如果在为true时,且在Web.xml中配置了注解,程序在编译时会报错,只需变更此参数为false即可。

            在Servlet3.0的注解中,对应Servlet的启动顺序问题。解决方法:启用load-on-startup,如@WebServlet(load-on-startup=1)

            //整数小的在Web应用启动时立即优先实例化,不设定则在客户端第一次请求此servlet时时行实例化。

    例:参看配置头文件(如下)

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     id="WebApp_ID" version="3.1" metadata-complete="false">
     <display-name>PFAPP</display-name>
     <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      <welcome-file>default.html</welcome-file>
      <welcome-file>default.htm</welcome-file>
      <welcome-file>default.jsp</welcome-file>
     </welcome-file-list>
    </web-app>

  • 相关阅读:
    go基础_定时器
    作业3:写一个测试程序,消耗固定内存
    Hdu3397Sequence operation线段树
    Hdu3308LCIS线段树
    Poj3667Hotel线段树
    Poj1436Horizontally Visible Segments线段树
    Poj3225Help with Intervals区间线段树
    Poj2528Mayor's posters线段树
    poj3468A Simple Problem with Integers区间和线段树
    Hdu1698Just a Hook线段树区间更新
  • 原文地址:https://www.cnblogs.com/flycatnet/p/5122401.html
Copyright © 2011-2022 走看看