Skip to content

Instantly share code, notes, and snippets.

@rossbu
Created July 28, 2021 17:26
Show Gist options
  • Save rossbu/0ceaed94dd3dda635b540fd54bd434b4 to your computer and use it in GitHub Desktop.
Save rossbu/0ceaed94dd3dda635b540fd54bd434b4 to your computer and use it in GitHub Desktop.
print out system , server and application info in jsp
<%@
page contentType="text/html;charset=UTF-8" language="java"
%>
<%@ page import="java.util.*" %>
<html>
<head>
    <title></title>
</head>
<body>
Server info: <%= application.getServerInfo() %><br>
Servlet version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
JSP version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %><br>
Java version: <%= System.getProperty("java.version") %><br>
<%
Properties p = System.getProperties();
Enumeration keys = p.keys();
while (keys.hasMoreElements()) {
  String key = (String)keys.nextElement();
  String value = (String)p.get(key);
%>
<%=key%> :  <%=value%><br>
<%}%>
</body></html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment