From fcc5fd0c1f502a2e5aa262be7de05cb7f5b16eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A0=95=EC=9B=90?= Date: Thu, 3 Mar 2022 14:03:54 +0000 Subject: [PATCH] Update session-info.jsp hostname add --- src/main/webapp/jsp/session-info.jsp | 143 ++++++++++++++------------- 1 file changed, 74 insertions(+), 69 deletions(-) diff --git a/src/main/webapp/jsp/session-info.jsp b/src/main/webapp/jsp/session-info.jsp index b420153..5545605 100644 --- a/src/main/webapp/jsp/session-info.jsp +++ b/src/main/webapp/jsp/session-info.jsp @@ -1,69 +1,74 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - -<%@page import="java.util.*" %> -<%@page import="java.text.*" %> - - - - - -Insert title here - -<% -HttpSession sess = request.getSession(); -boolean isNew = session.isNew(); - String sessionId = session.getId(); - long creationTime = session.getCreationTime(); - long lastAccessedTime = session.getLastAccessedTime(); - int maxInactiveInterval = session.getMaxInactiveInterval(); - int rand_M=(int)(Math.random()*10000); - int rand_MS=(int)(Math.random()*10000); - - -if (sess.getAttribute("SessionAttr") ==null) { - out.println("

session out

"); -sess.setAttribute("SessionAttr", rand_M+""); -sess.setAttribute("SessionAttr2", rand_MS+""); -} else { - - - out.println("

session exist

"); - -} - - -java.util.Enumeration e = sess.getAttributeNames(); -%> - - - - - - - - - - - - - - - - - - - - - - -<% -String name = null; -while ( e.hasMoreElements() ) { -name = (String) e.nextElement(); -%> -

-<% -} -%> -
Session Info
Session ID<%=sessionId%>
isNewe<%=isNew%>
Creation Time<%=new Date(creationTime)%>
Last Accessed Time<%=new Date(lastAccessedTime)%>
Max Inactive Interval<%=maxInactiveInterval%>
Session Vaule List
NAMEVAULE
sessnion name <%=name%> <%=sess.getAttribute(name)%>
+<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + +<%@page import="java.util.*" %> +<%@page import="java.text.*" %> +<%@page import="java.net.InetAddress" %> + + + + + +Insert title here + +<% +HttpSession sess = request.getSession(); +boolean isNew = session.isNew(); + String sessionId = session.getId(); + long creationTime = session.getCreationTime(); + long lastAccessedTime = session.getLastAccessedTime(); + int maxInactiveInterval = session.getMaxInactiveInterval(); + int rand_M=(int)(Math.random()*10000); + int rand_MS=(int)(Math.random()*10000); + + +if (sess.getAttribute("SessionAttr") ==null) { + out.println("

session out

"); +sess.setAttribute("SessionAttr", rand_M+""); +sess.setAttribute("SessionAttr2", rand_MS+""); +} else { + + + out.println("

session exist

"); + +} + + +java.util.Enumeration e = sess.getAttributeNames(); +String hostname = InetAddress.getLocalHost().getHostName(); +%> + + + + + + + + + + + + + + + + + + + + + + + + + +<% +String name = null; +while ( e.hasMoreElements() ) { +name = (String) e.nextElement(); +%> +

+<% +} +%> +
Session Info
Session ID<%=sessionId%>
isNewe<%=isNew%>
Creation Time<%=new Date(creationTime)%>
Last Accessed Time<%=new Date(lastAccessedTime)%>
Max Inactive Interval<%=maxInactiveInterval%>
hostname<%=hostname%>
Session Vaule List
NAMEVAULE
sessnion name <%=name%> <%=sess.getAttribute(name)%>