ServletContainerInitializer接口

  public interface ServletContainerInitializer

  一、介绍

  该接口,允许在 web 应用程序的启动阶段通知Library/Runtime, 并执行对Servlets、Filters和Listeners的任何必需的编程注册。

  此接口的实现必须由位于META-INF/services 目录内的JAR文件资源声明, 并以此接口的完全限定类名命名,and will be discovered using the runtime's service provider lookup mechanism or a container specific mechanism that is semantically equivalent to it.

  无论哪种情况,ServletContainerInitializer services from web fragment JAR files excluded from an absolute ordering must be ignored, and the order in which these services are discovered must follow the application's classloading delegation model.

  二、方法

  1、void onStartup(Set<Class<?>> c,ServletContext ctx) throws ServletException

  将指定的ServletContext所表示的应用程序的启动,告诉这个ServletContainerInitializer。

  如果将此 ServletContainerInitializer 绑定到应用程序的 WEB INF/lib 目录中的 JAR 文件中, 则它的 onStartup 方法将在捆绑应用程序启动期间只调用一次。

  如果此 ServletContainerInitializer 被捆绑在任何 WEB INF/lib 目录之外的 JAR 文件中, 但仍可发现, 如上文所述, 则每次启动应用程序时都会调用其 onStartup 方法。

  参数信息:

  c,the Set of application classes that extend, implement, or have been annotated with the class types specified by the HandlesTypes annotation, or null if there are no matches, or this ServletContainerInitializer has not been annotated with HandlesTypes

  ctx,the ServletContext of the web application that is being started and in which the classes contained in c were found

Java EE javax.servlet ServletContainerInitializer接口的更多相关文章

  1. Java EE javax.servlet中的ServletContext接口

    ServletContext接口 public interface ServletContext (https://docs.oracle.com/javaee/7/api/javax/servlet ...

  2. Java EE javax.servlet.http中的HttpSession接口

    HttpSession接口 public interface HttpSession (https://docs.oracle.com/javaee/7/api/javax/servlet/http/ ...

  3. Java EE javax.servlet中的ServletResponse接口

    ServletResponse接口 public interface ServletResponse 子接口:HttpServletResponse 实现类:HttpServletResponseWr ...

  4. Java EE javax.servlet中的ServletRequest接口

    ServletRequest接口 public interface ServletRequest 子接口:HttpServletRequest 实现类:HttpServletRequestWrappe ...

  5. Java EE javax.servlet中的RequestDispatcher接口

    RequestDispatcher接口 public interface RequestDispatcher 一.介绍 定义一个对象,从客户端接收请求并将其发送到服务器上的任何资源(例如servlet ...

  6. Java EE javax.servlet中的Servlet接口

    Servlet接口 public interface Servlet 其实现类有:FaceServlet.GenericServlet.HttpServlet 一.介绍 Servlet接口定义了所有s ...

  7. Java EE javax.servlet中的ServletConfig接口

    ServletConfig接口 public interface ServletConfig 实现类:GenericServlet.HttpServlet 一.介绍 一个供servlet容器使用配置对 ...

  8. Java EE javax.servlet.http中的HttpRequest抽象类

    HttpRequest抽象类 public abstract class HttpServlet extends GenericServlet 实现的接口有:Serializable, Servlet ...

  9. Caused by: java.lang.ClassCastException: org.springframework.web.SpringServletContainerInitializer cannot be cast to javax.servlet.ServletContainerInitializer错误解决办法

    严重: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] java. ...

随机推荐

  1. nginx的ngx_str_t

    在nginx里的ngx_tr_t结构是字符串定义如下 typedef struct { size_t len; u_char *data; }ngx_str_t; 在给这样的结构体赋值的时候,ngin ...

  2. WebSSH2 界面ssh(转载)

    工具:Virtual Machines14.1 系统环境:CentOS 7 64位 (2个)   IP:192.168.163.138 IP:192.168.163.141 概述:在138系统中安装部 ...

  3. Linux dd烧写系统

    虽然用dd指令烧写系统很简单,但是久而久之忘得也太快了,赶紧整理一下. .img 系统镜像 .iso U盘启动引导文件 1. 先来查看本机磁盘情况,打开Linux终端界面(快捷键Ctrl + Alt ...

  4. Python驱动Headless Chrome

    Headelss 比Headed的浏览器在内存消耗,运行时间,CPU占用都更具优势 from selenium import webdriverfrom selenium.webdriver.chro ...

  5. ffmpe转码添加时间水印

    ffmpeg出直播流的时候 添加时间水印的话可以观察延迟 录制也方便查问题下面的命令 需要用到的字体自己百度下载一下或者到C:\Windows\Fonts复制一下 ffmpeg -stream_loo ...

  6. Mac 卸载mysql

    sudo rm /usr/local/mysql sudo rm -rf /usr/local/mysql* sudo rm -rf /Library/StartupItems/MySQLCOM su ...

  7. python —— 文本特征提取 CountVectorize

    CountVectorize 来自:python学习 文本特征提取(二) CountVectorizer TfidfVectorizer 中文处理 - CSDN博客 https://blog.csdn ...

  8. 浅谈WebViewClient与WebChromeClient

    简介:WebViewClient被用来传递单纯的加载一个链接时所发生的事件,比如开始加载,结束加载等,它代表这个链接加载时的最普通的和最笼统的事件,WebChromeClient更多的是传递JS对话框 ...

  9. 代码bug管理工具bugfree与禅道

    禅道官网有一键安装包,一键安装即可用 bugfree 搭建lnmp环境   详情参考zabbix 解压bugfree包 到nginx的html里 unzip bugfree3.0.4.zip mv b ...

  10. Perfect-Server-Swift学习记录

    开发环境搭建: https://github.com/Perfect-Server-Swift-LearnGuide/PerfectLearnGuide 中文文档学习: https://www.per ...