1
내가 구현에 노력하고
public class JettyProxy {
public static void main(String[] args) throws Exception {
Server server = new Server();
CustomProxyServlet customProxyServlet = new CustomProxyServlet();
ServerConnector connector = new ServerConnector(server);
connector.setPort(8888);
server.addConnector(connector);
ConnectHandler proxy = new ConnectHandler();
server.setHandler(proxy);
ServletContextHandler context = new ServletContextHandler(proxy, "/",
ServletContextHandler.SESSIONS);
ServletHolder proxyServlet = new ServletHolder(customProxyServlet);
context.addServlet(proxyServlet, "/*");
if (context.getSessionHandler() == null) {
System.out.println("Session handler is null");
} else {
System.out.println("Session handler is not null");
}
if (context.getSessionHandler().getSessionManager() == null) {
System.out.println("Managaer it null");
} else {
System.out.println("Manager is not null");
}
context.getSessionHandler().addEventListener(new CustomSessionHandler());
server.start();
server.join();
}
}
SessionHandler는 코드가 아닙니다 프록시 서블릿 임베디드 부두와 인터페이스, 내가 SessionListener을 등록하지만, 전혀 불려 오지 못한, 여기 HttpSessionListener HttpSessionListener 구현 null, 세션을 만드는 이벤트가 발생하지 않습니다. 제발 도와주세요. 프로 시저가 세션 이벤트를 얻는 방법은 무엇입니까?