Hasor 使用 ServletContextListener

2018-10-09 15:43 更新

在 Hasor Web 中使用 ServletContextListener 如下所示,首先编写我们自己的 ServletContextListener,然后将它注册到 Hasor 中:

public class MyServletContextListener implements ServletContextListener {
    ...
}


然后将其注册到 Hasor 框架中:

public class StartModule extends WebModule {
    public void loadModule(WebApiBinder apiBinder) throws Throwable {
        ...
        apiBinder.addServletListener(MyServletContextListener.class);
        ...
    }
}


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号