Merge branch 'master' into 'main'

표준출력 쌓게끔 수정

See merge request jwkim6/acc-webapp!4
This commit is contained in:
김정원
2022-10-05 06:43:47 +00:00
7 changed files with 421 additions and 397 deletions

614
pom.xml
View File

@@ -1,307 +1,307 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kr.co.mantech</groupId>
<artifactId>acc-webapp-mvn</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>acc-webapp-mvn</name>
<description>Maven Accordion Webapp Test</description>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.8</java-version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- String -->
<org.springframework-version>4.3.14.RELEASE</org.springframework-version>
<org.aspectj-version>1.8.9</org.aspectj-version>
<!-- Web -->
<jsp.version>2.2.1</jsp.version>
<jstl.version>1.2.1</jstl.version>
<servlet.version>3.0.1</servlet.version>
<!-- Logging -->
<org.slf4j-version>1.7.25</org.slf4j-version>
<log4-version>1.2.17</log4-version>
<org.apache.tiles.version>3.0.3</org.apache.tiles.version>
<!-- Maven -->
<maven-eclipse-plugin-version>2.10</maven-eclipse-plugin-version>
<maven-compiler-plugin-version>3.7.0</maven-compiler-plugin-version>
<exec-maven-plugin-version>1.6.0</exec-maven-plugin-version>
<!-- DB -->
<dbh2.version>1.4.187</dbh2.version>
<mariadb.version>2.7.2</mariadb.version>
<webapp.lib>${basedir}/src/main/webapp/WEB-INF/lib</webapp.lib>
</properties>
<repositories>
<repository>
<id>myrepo</id>
<name>local-repo</name>
<url>file://${project.basedir}/lib</url>
</repository>
</repositories>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4-version}</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
<version>${jstl.version}</version>
<exclusions>
<!-- jstl-api was adding selvlet-api 2.5 and jsp-api-->
<exclusion>
<artifactId>jstl-api</artifactId>
<groupId>javax.servlet.jsp.jstl</groupId>
</exclusion>
</exclusions>
</dependency>
<!--
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
-->
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${org.apache.tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${org.apache.tiles.version}</version>
</dependency>
<!-- H2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${dbh2.version}</version>
</dependency>
<!-- Mariadb -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb.version}</version>
</dependency>
<!-- DBCP -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
<!--
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0</version>
</dependency>
-->
<!--
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.3.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>6.3.0</version>
</dependency>
-->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.0</version>
</dependency>
<!--
<dependency>
<groupId>kr.co.mantech</groupId>
<artifactId>javassist</artifactId>
<version>3.0</version>
<scope>system</scope>
<systemPath>${webapp.lib}/javassist.3.0.jar</systemPath>
</dependency>
-->
</dependencies>
<build>
<finalName>acc-webapp-mvn</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>kr.co.mantech</groupId>
<artifactId>acc-webapp-mvn</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>acc-webapp-mvn</name>
<packaging>war</packaging>
<description>Maven Accordion Webapp Test</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.8</java-version>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<!-- String -->
<org.springframework-version>4.3.14.RELEASE</org.springframework-version>
<org.aspectj-version>1.8.9</org.aspectj-version>
<!-- Web -->
<jsp.version>2.2.1</jsp.version>
<jstl.version>1.2.1</jstl.version>
<servlet.version>3.0.1</servlet.version>
<!-- Logging -->
<org.slf4j-version>1.7.25</org.slf4j-version>
<log4-version>1.2.17</log4-version>
<org.apache.tiles.version>3.0.3</org.apache.tiles.version>
<!-- Maven -->
<maven-eclipse-plugin-version>2.10</maven-eclipse-plugin-version>
<maven-compiler-plugin-version>3.7.0</maven-compiler-plugin-version>
<exec-maven-plugin-version>1.6.0</exec-maven-plugin-version>
<!-- DB -->
<dbh2.version>1.4.187</dbh2.version>
<mariadb.version>2.7.2</mariadb.version>
<webapp.lib>${basedir}/src/main/webapp/WEB-INF/lib</webapp.lib>
</properties>
<repositories>
<repository>
<id>myrepo</id>
<name>local-repo</name>
<url>file://${project.basedir}/lib</url>
</repository>
</repositories>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4-version}</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>runtime</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>javax.servlet.jsp.jstl-api</artifactId>
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>javax.servlet.jsp.jstl</artifactId>
<version>${jstl.version}</version>
<exclusions>
<!-- jstl-api was adding selvlet-api 2.5 and jsp-api-->
<exclusion>
<artifactId>jstl-api</artifactId>
<groupId>javax.servlet.jsp.jstl</groupId>
</exclusion>
</exclusions>
</dependency>
<!--
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
-->
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${org.apache.tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${org.apache.tiles.version}</version>
</dependency>
<!-- H2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${dbh2.version}</version>
</dependency>
<!-- Mariadb -->
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb.version}</version>
</dependency>
<!-- DBCP -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.maven/maven-plugin-api -->
<!--
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0</version>
</dependency>
-->
<!--
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
<version>6.3.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-client</artifactId>
<version>6.3.0</version>
</dependency>
-->
<dependency>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.0</version>
</dependency>
<!--
<dependency>
<groupId>kr.co.mantech</groupId>
<artifactId>javassist</artifactId>
<version>3.0</version>
<scope>system</scope>
<systemPath>${webapp.lib}/javassist.3.0.jar</systemPath>
</dependency>
-->
</dependencies>
<build>
<finalName>acc-webapp-mvn</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -1,13 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>WEBAPP</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<distributable/>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>WEBAPP</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

View File

@@ -4,7 +4,7 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<ul>
<c:set var="contextPath" value="<%= request.getContextPath()%>"></c:set>
<li><a href="${contextPath}/pages/1.jsp">기본페이지 호출</a></li >
<li><a href="${contextPath}/pages/default.jsp">기본페이지 호출(표준출력테스트)</a></li >
<li> F01 : 클라이언트 분리 호출(이미지/JSP) </li>
<ul>

View File

@@ -9,8 +9,24 @@
<body>
<h1 style=" padding:10px;" width=100%> APM BMT !!</h1>
<h1 style=" padding:10px;" width=100%> 샘플 페이지 기본출력) !!</h1>
<%
System.out.println("=========================");
System.out.println("= =");
System.out.println("= =");
System.out.println("= =");
System.out.println("= =");
System.out.println("= 표준출력 =");
System.out.println("= =");
System.out.println("= =");
System.out.println("= =");
System.out.println("= =");
System.out.println("=========================");
%>
</body>
</html>

View File

@@ -6,7 +6,7 @@ APM BMT 테스트
</H2>
1) 기본 페이지 <br>
http://IP/NIA-APM-BMT/jsp/common/normal.jsp <br>
http://IP/jsp/common/normal.jsp <br>

View File

@@ -1,74 +1,74 @@
<%@ 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" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%
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("<h2> session out </h2>");
sess.setAttribute("SessionAttr", rand_M+"");
sess.setAttribute("SessionAttr2", rand_MS+"");
} else {
out.println("<h2> session exist </h2>");
}
java.util.Enumeration e = sess.getAttributeNames();
String hostname = InetAddress.getLocalHost().getHostName();
%>
<table border=1 bordercolor="gray" cellspacing=1 cellpadding=0 width="100%">
<tr bgcolor="gray"><td colspan=2 align="center"><font color="white"><b>Session Info</b></font></td></tr>
<tr>
<td width="25%">Session ID</td><td width="75%"><%=sessionId%></td>
</tr>
<tr>
<td>isNewe</td><td><%=isNew%></td>
</tr>
<tr>
<td>Creation Time</td><td><%=new Date(creationTime)%></td>
</tr>
<tr>
<td>Last Accessed Time</td><td><%=new Date(lastAccessedTime)%></td>
</tr>
<tr>
<td>Max Inactive Interval</td><td><%=maxInactiveInterval%></td>
</tr>
<tr>
<td>hostname</td><td><%=hostname%></td>
</tr>
<tr bgcolor="cyan"><td colspan=2 align="center"><b>Session Vaule List<b></td></tr>
<tr>
<td align="center">NAME</td>
<td align="center">VAULE</td>
</tr>
<%
String name = null;
while ( e.hasMoreElements() ) {
name = (String) e.nextElement();
%>
<tr><BR><td align="left">sessnion name <%=name%></td><BR> <td align="left"><%=sess.getAttribute(name)%></td></tr>
<%
}
%>
</table>
<%@ 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" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<%
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("<h2> session out </h2>");
sess.setAttribute("SessionAttr", rand_M+"");
sess.setAttribute("SessionAttr2", rand_MS+"");
} else {
out.println("<h2> session exist </h2>");
}
java.util.Enumeration e = sess.getAttributeNames();
String hostname = InetAddress.getLocalHost().getHostName();
%>
<table border=1 bordercolor="gray" cellspacing=1 cellpadding=0 width="100%">
<tr bgcolor="gray"><td colspan=2 align="center"><font color="white"><b>Session Info</b></font></td></tr>
<tr>
<td width="25%">Session ID</td><td width="75%"><%=sessionId%></td>
</tr>
<tr>
<td>isNewe</td><td><%=isNew%></td>
</tr>
<tr>
<td>Creation Time</td><td><%=new Date(creationTime)%></td>
</tr>
<tr>
<td>Last Accessed Time</td><td><%=new Date(lastAccessedTime)%></td>
</tr>
<tr>
<td>Max Inactive Interval</td><td><%=maxInactiveInterval%></td>
</tr>
<tr>
<td>hostname</td><td><%=hostname%></td>
</tr>
<tr bgcolor="cyan"><td colspan=2 align="center"><b>Session Vaule List<b></td></tr>
<tr>
<td align="center">NAME</td>
<td align="center">VAULE</td>
</tr>
<%
String name = null;
while ( e.hasMoreElements() ) {
name = (String) e.nextElement();
%>
<tr><BR><td align="left">sessnion name <%=name%></td><BR> <td align="left"><%=sess.getAttribute(name)%></td></tr>
<%
}
%>
</table>

View File

@@ -0,0 +1,9 @@
localhost_access_log.2022-10-05.txt<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:include page="/jsp/common/template.jsp">
<jsp:param name="content" value="/jsp/normal.jsp"/>
<jsp:param name="title" value="1-1"/>
</jsp:include>