HttpSessionListener statistics online number

xiaoxiao2021-03-06  45

Package sessioncount;

Import javax.servlet. *;

Import javax.servlet.http. *;

Public class sessioncounter implements httpsessionListener {

Private static int activitynesss = 0;

Public void sessioncreated (httpsessioneverment se) {

ActiveSessionS ;

}

Public void sessiondestroyed (httpsessionever se) {

IF (ActiveSESSES> 0)

Activeismions

}

Public static int getActivenesss () {

Return Activeism;

}

}

Then you need to build web.xml in your website's web-infers.

The document content is as follows:

sessioncount.sessioncounter

转载请注明原文地址:https://www.9cbs.com/read-71554.html

New Post(0)