import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class MyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
response.setContentType("text/html");
java.io.PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
out.println("");
out.println("");
out.println("Simple Session Tracker");
out.println("");
out.println("");
out.println("Session Info
");
out.println("session Id: " + session.getId() + "
");
out.println( "The SESSION TIMEOUT period is " + session.getMaxInactiveInterval() + " seconds.
");
out.println( "Now changing it to 20 minutes.
");
session.setMaxInactiveInterval(20 * 60);
out.println("The SESSION TIMEOUT period is now " + session.getMaxInactiveInterval() + " seconds.");
out.println("");
out.println("");
}
/** Handles the HTTP POST
method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
doGet(request,response);
}
}
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
MyServletName
MyServlet
MyServletName
/index.html