-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster-index.jsp
36 lines (36 loc) · 1.2 KB
/
cluster-index.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
<title>Cluster App Test</title>
</head>
<body>
Server Info:
<%
out.println(request.getLocalName() + " : " + request.getLocalPort()
+ "<br>");
%>
<%
out.println("<br> ID " + session.getId() + "<br>");
String dataName = request.getParameter("dataName");
if (dataName != null && dataName.length() > 0) {
String dataValue = request.getParameter("dataValue");
session.setAttribute(dataName, dataValue);
}
out.print("<b>Session ??</b>");
Enumeration e = session.getAttributeNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String value = session.getAttribute(name).toString();
out.println(name + " = " + value + "<br>");
System.out.println(name + " = " + value);
}
%>
<form action="index.jsp" method="POST">Name:
<input type=text size=20 name="dataName">
<br>Value:
<input type=text size=20 name="dataValue">
<br>
<input type=submit>
</form>
</body>
</html>