Skip to content

Instantly share code, notes, and snippets.

@tksst
Created February 18, 2015 03:52
Show Gist options
  • Save tksst/01ffe286c6f716f3f341 to your computer and use it in GitHub Desktop.
Save tksst/01ffe286c6f716f3f341 to your computer and use it in GitHub Desktop.
<%-- 手っ取り早くセッションのテストをするJSP --%><%@
page contentType="text/plain; charset=UTF-8"%><%
int num = 0;
if (!session.isNew()) {
num = ((Integer)session.getAttribute("num")).intValue();
}
%>num: <%= num++ %>
session ID: <%= session.getId() %>
session created: <%= session.getCreationTime() %>
<% session.setAttribute("num", new Integer(num)); %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment