Java EE javax.servlet ServletContainerInitializer接口
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接口的更多相关文章
- Java EE javax.servlet中的ServletContext接口
ServletContext接口 public interface ServletContext (https://docs.oracle.com/javaee/7/api/javax/servlet ...
- Java EE javax.servlet.http中的HttpSession接口
HttpSession接口 public interface HttpSession (https://docs.oracle.com/javaee/7/api/javax/servlet/http/ ...
- Java EE javax.servlet中的ServletResponse接口
ServletResponse接口 public interface ServletResponse 子接口:HttpServletResponse 实现类:HttpServletResponseWr ...
- Java EE javax.servlet中的ServletRequest接口
ServletRequest接口 public interface ServletRequest 子接口:HttpServletRequest 实现类:HttpServletRequestWrappe ...
- Java EE javax.servlet中的RequestDispatcher接口
RequestDispatcher接口 public interface RequestDispatcher 一.介绍 定义一个对象,从客户端接收请求并将其发送到服务器上的任何资源(例如servlet ...
- Java EE javax.servlet中的Servlet接口
Servlet接口 public interface Servlet 其实现类有:FaceServlet.GenericServlet.HttpServlet 一.介绍 Servlet接口定义了所有s ...
- Java EE javax.servlet中的ServletConfig接口
ServletConfig接口 public interface ServletConfig 实现类:GenericServlet.HttpServlet 一.介绍 一个供servlet容器使用配置对 ...
- Java EE javax.servlet.http中的HttpRequest抽象类
HttpRequest抽象类 public abstract class HttpServlet extends GenericServlet 实现的接口有:Serializable, Servlet ...
- 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. ...
随机推荐
- Python中的变量、对象
由于没时间系统学习下Python 只能见一个问题探究一个问题了 一.初级 - 对象 关于Python中的数据类型,今天重新认识了下.[参考] 首先,Python中,对象才有类型, 变量是没有类型的,它 ...
- flutter中的生命周期函数
前言:生命周期是一个组件加载到卸载的整个周期,熟悉生命周期可以让我们在合适的时机做该做的事情,flutter中的State生命周期和android以及React Native的生命周期类似. 先看一张 ...
- HearthBuddy中_settings.txt的更详细参数解释
https://tieba.baidu.com/p/5275382967 默认的配置不是很合理,花了点时间读了下silverfish(也就是兄弟用的AI)的代码后也尝试修改了些参数,有没有效果仁者见仁 ...
- SpringCloud(二)之Ribbon的实现负载均衡的基本应用
一 Ribbon简介 Ribbon是Netflix发布的负载均衡器,它是一个基于HTTP和TCP的客户端负载均衡工具,它基于Netflix Ribbon实现.通过Spring Cloud的封装 ...
- 谈谈我对证券公司一些部门的理解(前、中、后台)[z]
[z]https://blog.csdn.net/UniRong/article/details/79289947 文中对各大部门的分析都是从作者多年经历总结出来的有感之谈,尤其是前台的6大部门(经纪 ...
- Java中非静态成员变量、静态成员变量的初始化时机
转: Java中非静态成员变量.静态成员变量的初始化时机. 2018年05月22日 11:48:11 SilenceCarrot 阅读数 421 版权声明:技术就要分享才有意思,欢迎大家分享(注明 ...
- 使用AOP思想封装JDBC
看代码 package learning.aop2; import org.springframework.stereotype.Component; import java.sql.SQLExcep ...
- SSM+form表单文件上传
这里介绍SSM如何配置上传文件 配置springmvc.xml: <!--配置上传下载--> <bean id="multipartResolver" class ...
- 在SuSE安装wifidog认证服务器和网关
在SuSE安装认证服务器和网关 在openSuSE 10.3安装wifidog 认证服务器和网关在同台设备中安装完毕.以下是openSuSE的详细安装指南.这个安装是非常初级的,所以请验证或更正. - ...
- jenkins报错解决
https://www.cnblogs.com/yangxia-test/p/4368778.html https://blog.csdn.net/xlyrh/article/details/5138 ...