Skip to content

Instantly share code, notes, and snippets.

@heiwa4126
Created December 16, 2020 08:24
Show Gist options
  • Save heiwa4126/6f19a59fd906c4d83baa9009f2db5231 to your computer and use it in GitHub Desktop.
Save heiwa4126/6f19a59fd906c4d83baa9009f2db5231 to your computer and use it in GitHub Desktop.
Tomcatの動作チェックに日付とTomcat、JDKのバージョンがでるやつがほしいと言われたので作ったやつ。
<%@
page import="java.time.*"
contentType="text/html; charset=utf8"
%><!DOCTYPE html>
<html>
<head lang="en">
<meta charset="utf-8">
</head>
<title>Hello, Tomcat</title>
</head>
<body>
<%
LocalDateTime now = LocalDateTime.now(ZoneId.of("Asia/Tokyo"));
%><h1>Hello, Tomcat</h1>
<p>It's <strong><%= now %> +0900</strong>.</p>
<p>JDK version : <%= System.getProperty("java.version") %><br>
Tomcat Version : <%= application.getServerInfo() %></p>
</body>
</html>
@heiwa4126
Copy link
Author

webappsに適当なフォルダをmkdirして、そこへwgetとかcurl -Oしてください。時間は日本時間がいい、とか言われたのでそうなってます。あとsession="false"はあったほうがいいかも。

@heiwa4126
Copy link
Author

warのサンプルはTomcatのドキュメントにあるsample.warでも使ってください。
Sample Applicationの"here"のとこ。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment