在 Servlet 中,我们有 ServletConfig 和 ServletContext。通过API,我看到两者都是接口。以下是我的疑惑
1.ServletConfig和ServletContext是接口,如果是接口,这些对象是如何创建的?
2.是不是容器的类实现了这些接口并提供了实现?
3.在哪里可以找到ServletConfig和ServletContext的实例化代码?
4. ServletConfig 和 ServletContext 究竟是什么时候创建的。
我还读到有 SerlvetContextListener,它有方法 context Created() 和 contextDestroyed()。并且这些方法在服务器启动时被调用。这是我们如何知道 ServletContext 对象已创建的方式吗?仅仅阅读这本书并没有让我清楚地了解 ServletConfig 和 ServletContext。想知道这些代码是如何创建的。有人可以解释或提供链接,以便我可以通过并获得清晰的图片