Custom JSP taglib. You can use this taglib with Sessions listener from JSOS. Listener collects statistics for sessions (how many sessions are active, what was the peak value for active sessions, total counter for sessions, minimal, maximal and average life time for sessions) and this taglib lets you use accumulated data in your JSP files. How to use it: At the first hand you have to install filter (listener) for sessions statistics. See Sessions statistics in JSOS package. After that you may use an appropriate custom tag in your JSP page. For example:
<%@ taglib uri="taglib.tld" prefix="stat" %> <!-- how many sessions are active --> <stat:CurrentCounter/> <!-- average life time for sessions --> <stat:AvgLifeTime/> Tags are: CurrentCounter Counts active (open) sessions. Parameters are: 1) id Optional parameter. Describes a name for page scope variable (type is java.lang.Long). Data will be saved in this variable. Without this parameter tag just prints data. TotalCounter Counts all (historically) opened sessions. Parameters are: 1) id Optional parameter. Describes a name for page scope variable (type is java.lang.Long). Data will be saved in this variable. Without this parameter tag just prints data. PeakCounter Keeps maximal value for simultaneously opened sessions. Parameters are: 1) id Optional parameter. Describes a name for page scope variable (type is java.lang.Long). Data will be saved in this variable. Without this parameter tag just prints data. MinLifeTime Keeps minimal life time for sessions (in seconds). Parameters are: 1) id Optional parameter. Describes a name for page scope variable (type is java.lang.Long). Data will be saved in this variable. Without this parameter tag just prints data. MaxLifeTime Keeps maximal life time for sessions (in seconds). Parameters are: 1) id Optional parameter. Describes a name for page scope variable (type is java.lang.Long). Data will be saved in this variable. Without this parameter tag just prints data. AvgLifeTime Keeps average life time for sessions (in seconds). Parameters are: 1) id Optional parameter. Describes a name for page scope variable (type is java.lang.Long). Data will be saved in this variable. Without this parameter tag just prints data. Reset Resets stats data. Parameters are: 1) cond Optional parameter. Describes a boolean value tag's behavior depends on. Default value is true (reset data). for downloading: Library: sesslist.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|