public class SampleServlet extends HttpServlet {
public void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException,IOException {
response.setCharacterEncoding("Windows-31J");
PrintWriter out = response.getWriter();
out.println("<html><body>");
HttpSession session = request.getSession();
out.println("セッション最終アクセス時刻:" + new Date( session.getLastAccessedTime() ) );
out.println("</body></html>");
}
}
|