//startPage.html
Page 1
URL Re-writing Demo
Click here to visit page 2.
//page2.jsp
Page 2
URL Re-writing Demo
">Click here to visit page 1.
//page1.jsp
Page 1
URL Re-writing Demo
">Click here to visit page 2.
///
//web.xml
"http://java.sun.com/dtd/web-app_2_3.dtd">
com.rntsoft.SessionCount
http://java.sun.com/jstl/core
/WEB-INF/c.tld
//sessionCounter.jsp
Session Counter
Session Counter
On this server, there are currently
<%=com.rntsoft.SessionCount.getNumberOfSessions()%> active sessions.
package com.rntsoft;
import javax.servlet.http.*;
public class SessionCount implements HttpSessionListener
{
private static int numberOfSessions = 0;
public void sessionCreated (HttpSessionEvent evt)
{
numberOfSessions++;
}
public void sessionDestroyed (HttpSessionEvent evt)
{
numberOfSessions--;
}
// here is our own method to return the number of current sessions
public static int getNumberOfSessions()
{
return numberOfSessions;
}
}