From bad68f762bc4aabda66fc1f3eefa6450c53606c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=B1=E4=B8=9C=E5=B0=8F=E6=9C=A8?= <909854136@qq.com> Date: Mon, 22 Mar 2021 11:25:56 +0800 Subject: [PATCH] =?UTF-8?q?WebBuilder.java=E9=87=8C=E5=A2=9E=E5=8A=A0addSe?= =?UTF-8?q?ssionListener(listener)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/jfinal/server/undertow/WebBuilder.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/jfinal/server/undertow/WebBuilder.java b/src/main/java/com/jfinal/server/undertow/WebBuilder.java index d68df65..0300928 100644 --- a/src/main/java/com/jfinal/server/undertow/WebBuilder.java +++ b/src/main/java/com/jfinal/server/undertow/WebBuilder.java @@ -26,6 +26,7 @@ import io.undertow.servlet.api.FilterInfo; import io.undertow.servlet.api.ListenerInfo; import io.undertow.servlet.api.ServletInfo; import io.undertow.servlet.api.SessionManagerFactory; +import io.undertow.server.session.SessionListener; /** * WebBuilder 用于构建 WebSocket、Filter、Servlet、Listener @@ -132,6 +133,13 @@ public class WebBuilder { deploymentInfo.addListener(new ListenerInfo(listener)); return this; } + + // --------- SessionListener + + public WebBuilder addSessionListener(SessionListener sessionListener) { + deploymentInfo.addSessionListener(sessionListener); + return this; + } // --------- WebSocket -- Gitee