これは遅い応答ですが、これを検索していたので追加しました。
簡単なセッション get/put jsp スクリプトを次に示します。
<html>
<body>
<a href="testsession.jsp?action=put">put</a>
<a href="testsession.jsp?action=get">get</a>
<%
String action = request.getParameter("action");
if ( null != action && "put".equals(action) ) {
%>
<h2>Set Current Time</h2>
<%
System.out.println( "Putting date now" );
session.setAttribute("current.time", new java.util.Date());
%>
The time is set to <%= session.getAttribute("current.time") %>
<% } else { %>
<h2>Get Time</h2>
<%
System.out.println( "Getting date now" );
%>
The time is <%= session.getAttribute("current.time") %>
<% } %>
<br>
<br>
server: <%=request.getServerName() %>
<br>
<br>
session: <%= session.getId() %>
</body>
</html>
コマンドラインを使用している場合は、両方のノードでこれを使用できます。
curl --cookie "JSESSIONID=ZWarGbkuDUoUuT-iOjYIATN+.2e84d3e9-3497-3e74-9604-a45f36cad465;" http://node1/your_test_page
curl --cookie "JSESSIONID=ZWarGbkuDUoUuT-iOjYIATN+.2e84d3e9-3497-3e74-9604-a45f36cad465;" http://node2/your_test_page
ブラウザと両方のコマンド ライン テストで返された時間が表示されます。