Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ page contentType="text/html;charset=UTF-8" language="java" %>
- <%@ page import="java.io.*, java.net.*, java.util.*" %>
- <%
- int currentJvm = Runtime.getRuntime().hashCode();
- int previousJvm = 0;
- if (session.getAttribute("previous_jvm") != null) {
- previousJvm = (Integer) session.getAttribute("previous_jvm");
- }
- // Make sure sessions-enabled=true in WEB-INF/appengine-web.xml
- session.setAttribute("previous_jvm", currentJvm);
- %>
- <html>
- <head>
- <title>JVM: <%= currentJvm %></title>
- </head>
- <body style="font-family: courier;">
- This request was handled by JVM #<%= currentJvm %>.<p />
- <% if (previousJvm != 0) { %>
- Your previous request was handled by JVM #<%= previousJvm %>.<p />
- <% } %>
- <% if (previousJvm != 0 && currentJvm != previousJvm) { %>
- <b style="color: red;">Current JVM != Previous JVM</b><p />
- <% } %>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement