1"use strict";(globalThis.webpackChunkhasor_doc=globalThis.webpackChunkhasor_doc||[]).push([[9470],{6132(e,s,t){t.r(s),t.d(s,{assets:()=>l,contentTitle:()=>c,default:()=>p,frontMatter:()=>o,metadata:()=>n,toc:()=>a});const n=JSON.parse('{"id":"guides/webmvc/j2ee/listener","title":"4.8.3 Listener","description":"Hasor \u6846\u67b6\u5f00\u53d1\u624b\u518c\uff0c\u8986\u76d6 hasor-core\u3001hasor-web\u3001hasor-boot \u7684\u6838\u5fc3\u7528\u6cd5","source":"@site/docs/guides/webmvc/j2ee/listener.md","sourceDirName":"guides/webmvc/j2ee","slug":"/guides/webmvc/j2ee/listener","permalink":"/docs/guides/webmvc/j2ee/listener","draft":false,"unlisted":false,"editUrl":"https://gitee.com/zycgit/hasor-doc/tree/master/docs/guides/webmvc/j2ee/listener.md","tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"id":"listener","sidebar_position":3,"title":"4.8.3 Listener","description":"Hasor \u6846\u67b6\u5f00\u53d1\u624b\u518c\uff0c\u8986\u76d6 hasor-core\u3001hasor-web\u3001hasor-boot \u7684\u6838\u5fc3\u7528\u6cd5"},"sidebar":"guides","previous":{"title":"4.8.2 Filter","permalink":"/docs/guides/webmvc/j2ee/filter"},"next":{"title":"4.8.4 \u5f02\u6b65\u8bf7\u6c42(Servlet3.0)","permalink":"/docs/guides/webmvc/j2ee/async"}}');var r=t(4848),i=t(8453);const o={id:"listener",sidebar_position:3,title:"4.8.3 Listener",description:"Hasor \u6846\u67b6\u5f00\u53d1\u624b\u518c\uff0c\u8986\u76d6 hasor-core\u3001hasor-web\u3001hasor-boot \u7684\u6838\u5fc3\u7528\u6cd5"},c="4.8.3 Listener",l={},a=[];function d(e){const s={code:"code",h1:"h1",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.header,{children:(0,r.jsx)(s.h1,{id:"483-listener",children:"4.8.3 Listener"})}),"\n",(0,r.jsxs)(s.p,{children:["J2EE \u89c4\u8303\u4e2d\u5b9a\u4e49\u4e86\u5404\u79cd\u5404\u6837\u7684 Listener \u4f8b\u5982 ",(0,r.jsx)(s.code,{children:"javax.servlet.http.HttpSessionListener"})]}),"\n",(0,r.jsx)(s.p,{children:"\u8fd9\u4e9b Listener \u57fa\u672c\u5728 Hasor \u4e2d\u90fd\u662f\u90fd\u662f\u652f\u6301\u7684\uff0c\u914d\u7f6e\u5b83\u4eec\u9700\u8981\u901a\u8fc7 SPI \u7684\u5f62\u5f0f\u6765\u6ce8\u518c\u3002\u4f8b\u5982\uff1a"}),"\n",(0,r.jsx)(s.pre,{children:(0,r.jsx)(s.code,{className:"language-java",metastring:"title='\u4f8b\u5b50'",children:"public class MyHttpSessionListener implements HttpSessionListener {\n ...\n}\n\npublic class StartModule implements WebModule {\n public void loadModule(WebApiBinder apiBinder) throws Throwable {\n ...\n apiBinder.bindSpiListener(HttpSessionListener.class, new MyHttpSessionListener());\n ...\n }\n}\n"})}),"\n",(0,r.jsx)(s.p,{children:"\u76ee\u524d Hasor \u5df2\u7ecf\u652f\u6301\u7684 J2EE Listener\u6e05\u5355\u6709\uff1a"}),"\n",(0,r.jsxs)(s.ul,{children:["\n",(0,r.jsx)(s.li,{children:(0,r.jsx)(s.code,{children:"javax.servlet.http.HttpSessionListener"})}),"\n",(0,r.jsx)(s.li,{children:(0,r.jsx)(s.code,{children:"javax.servlet.ServletContextListener"})}),"\n",(0,r.jsx)(s.li,{children:(0,r.jsx)(s.code,{children:"javax.servlet.ServletRequestListener"})}),"\n"]})]})}function p(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,r.jsx)(s,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453(e,s,t){t.d(s,{R:()=>o,x:()=>c});var n=t(6540);const r={},i=n.createContext(r);function o(e){const s=n.useContext(i);return n.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),n.createElement(i.Provider,{value:s},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.