2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-18 15:26:16 +00:00

Add Java Server Page (JSP) syntax test file

This commit is contained in:
Mohamed Abdelnour 2021-05-29 02:27:30 +02:00 committed by David Peter
parent 1ced35ec76
commit 64cbfbed47
4 changed files with 1603 additions and 0 deletions

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<%--
 Licensed to the Apache Software Foundation (ASF) under one or more
 contributor license agreements. See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The ASF licenses this file to You under the Apache License, Version 2.0
 (the "License"); you may not use this file except in compliance with
 the License. You may obtain a copy of the License at
 http://www.apache.org/licenses/LICENSE-2.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
--%>
<%@page session="false" contentType="text/html; charset=ISO-8859-1" %>
<%@page import="java.util.Enumeration" %>
<%@page import="jakarta.servlet.http.HttpSession" %>
<%@page import="org.apache.catalina.Session" %>
<%@page import="org.apache.catalina.manager.JspHelper" %>
<%@page import="org.apache.catalina.util.ContextName" %>
<!DOCTYPE html
 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<% String path = (String) request.getAttribute("path");
 String version = (String) request.getAttribute("version");
 ContextName cn = new ContextName(path, version);
 Session currentSession = (Session)request.getAttribute("currentSession");
 String currentSessionId = null;
 HttpSession currentHttpSession = null;
 if (currentSession != null) {
 currentHttpSession = currentSession.getSession();
 currentSessionId = JspHelper.escapeXml(currentSession.getId());
 } else {
 currentSessionId = "Session invalidated";
 }
 String submitUrl = JspHelper.escapeXml(response.encodeURL(
 ((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
 "?path=" + path + "&version=" + version));
%>
<head>
 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
 <meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->
 <meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->
 <meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
 <meta http-equiv="content-language" content="en"/>
 <meta name="author" content="Cedrik LIME"/>
 <meta name="copyright" content="copyright 2005-2021 the Apache Software Foundation"/>
 <meta name="robots" content="noindex,nofollow,noarchive"/>
 <title>Sessions Administration: details for <%= currentSessionId %></title>
</head>
<body>
<% if (currentHttpSession == null) { %>
 <h1><%=currentSessionId%></h1>
<% } else { %>
 <h1>Details for Session <%= currentSessionId %></h1>
 <table style="text-align: left;" border="0">
 <tr>
 <th>Session Id</th>
 <td><%= currentSessionId %></td>
 </tr>
 <tr>
 <th>Guessed Locale</th>
 <td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
 </tr>
 <tr>
 <th>Guessed User</th>
 <td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
 </tr>
 <tr>
 <th>Creation Time</th>
 <td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
 </tr>
 <tr>
 <th>Last Accessed Time</th>
 <td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
 </tr>
 <tr>
 <th>Session Max Inactive Interval</th>
 <td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
 </tr>
 <tr>
 <th>Used Time</th>
 <td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
 </tr>
 <tr>
 <th>Inactive Time</th>
 <td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
 </tr>
 <tr>
 <th>TTL</th>
 <td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
 </tr>
 </table>
 <form method="post" action="<%= submitUrl %>">
 <div>
 <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
 <input type="hidden" name="action" value="sessionDetail" />
 <%
 if ("Primary".equals(request.getParameter("sessionType"))) {
 %>
 <input type="hidden" name="sessionType" value="Primary" />
 <%
 }
 %> <input type="submit" value="Refresh" />
 </div>
 </form>
 <div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
 <div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
 <table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
 <% int nAttributes = 0;
 Enumeration<String> attributeNamesEnumeration = currentHttpSession.getAttributeNames();
 while (attributeNamesEnumeration.hasMoreElements()) {
 attributeNamesEnumeration.nextElement();
 ++nAttributes;
 }
 %>
 <caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
 <thead>
 <tr>
 <th>Remove Attribute</th>
 <th>Attribute name</th>
 <th>Attribute value</th>
 </tr>
 </thead>
 <%--tfoot>
 <tr>
 <td colspan="3" style="text-align: center;">
 TODO: set Max Inactive Interval on sessions
 </td>
 </tr>
 </tfoot--%>
 <tbody>
 <% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
 while (attributeNamesEnumeration.hasMoreElements()) {
 String attributeName = attributeNamesEnumeration.nextElement();
 %>
 <tr>
 <td align="center">
 <form method="post" action="<%= submitUrl %>">
 <div>
 <input type="hidden" name="action" value="removeSessionAttribute" />
 <input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
 <input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
 <%
 if ("Primary".equals(request.getParameter("sessionType"))) {
 %>
 <input type="submit" value="Remove" />
 <input type="hidden" name="sessionType" value="Primary" />
 <%
 } else {
 out.print("Primary sessions only");
 }
 %>
 </div>
 </form>
 </td>
 <td><%= JspHelper.escapeXml(attributeName) %></td>
 <td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
 </tr>
 <% } // end while %>
 </tbody>
 </table>
<% } // endif%>
<form method="post" action="<%=submitUrl%>">
 <p style="text-align: center;">
 <input type="submit" value="Return to session list" />
 </p>
</form>
<%--div style="display: none;">
<p>
 <a href="http://validator.w3.org/check?uri=referer"><img
 src="http://www.w3.org/Icons/valid-html401"
 alt="Valid HTML 4.01!" height="31" width="88"></a>
 <a href="http://validator.w3.org/check?uri=referer"><img
 src="http://www.w3.org/Icons/valid-xhtml10"
 alt="Valid XHTML 1.0!" height="31" width="88" /></a>
 <a href="http://validator.w3.org/check?uri=referer"><img
 src="http://www.w3.org/Icons/valid-xhtml11"
 alt="Valid XHTML 1.1!" height="31" width="88" /></a>
</p>
</div--%>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,68 @@
Apache Tomcat
Copyright 1999-2021 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).
This software contains code derived from netty-native
developed by the Netty project
(https://netty.io, https://github.com/netty/netty-tcnative/)
and from finagle-native developed at Twitter
(https://github.com/twitter/finagle).
This software contains code derived from jgroups-kubernetes
developed by the JGroups project (http://www.jgroups.org/).
The Windows Installer is built with the Nullsoft
Scriptable Install System (NSIS), which is
open source software. The original software and
related information is available at
http://nsis.sourceforge.net.
Java compilation software for JSP pages is provided by the Eclipse
JDT Core Batch Compiler component, which is open source software.
The original software and related information is available at
https://www.eclipse.org/jdt/core/.
org.apache.tomcat.util.json.JSONParser.jj is a public domain javacc grammar
for JSON written by Robert Fischer.
https://github.com/RobertFischer/json-parser
For portions of the Tomcat JNI OpenSSL API and the OpenSSL JSSE integration
The org.apache.tomcat.jni and the org.apache.tomcat.net.openssl packages
are derivative work originating from the Netty project and the finagle-native
project developed at Twitter
* Copyright 2014 The Netty Project
* Copyright 2014 Twitter
For portions of the Tomcat cloud support
The org.apache.catalina.tribes.membership.cloud package contains derivative
work originating from the jgroups project.
https://github.com/jgroups-extras/jgroups-kubernetes
Copyright 2002-2018 Red Hat Inc.
The original XML Schemas for Java EE Deployment Descriptors:
- javaee_5.xsd
- javaee_web_services_1_2.xsd
- javaee_web_services_client_1_2.xsd
- javaee_6.xsd
- javaee_web_services_1_3.xsd
- javaee_web_services_client_1_3.xsd
- jsp_2_2.xsd
- web-app_3_0.xsd
- web-common_3_0.xsd
- web-fragment_3_0.xsd
- javaee_7.xsd
- javaee_web_services_1_4.xsd
- javaee_web_services_client_1_4.xsd
- jsp_2_3.xsd
- web-app_3_1.xsd
- web-common_3_1.xsd
- web-fragment_3_1.xsd
- javaee_8.xsd
- web-app_4_0.xsd
- web-common_4_0.xsd
- web-fragment_4_0.xsd
may be obtained from:
http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<%--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<%@page session="false" contentType="text/html; charset=ISO-8859-1" %>
<%@page import="java.util.Enumeration" %>
<%@page import="jakarta.servlet.http.HttpSession" %>
<%@page import="org.apache.catalina.Session" %>
<%@page import="org.apache.catalina.manager.JspHelper" %>
<%@page import="org.apache.catalina.util.ContextName" %>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%--!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"--%>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<% String path = (String) request.getAttribute("path");
String version = (String) request.getAttribute("version");
ContextName cn = new ContextName(path, version);
Session currentSession = (Session)request.getAttribute("currentSession");
String currentSessionId = null;
HttpSession currentHttpSession = null;
if (currentSession != null) {
currentHttpSession = currentSession.getSession();
currentSessionId = JspHelper.escapeXml(currentSession.getId());
} else {
currentSessionId = "Session invalidated";
}
String submitUrl = JspHelper.escapeXml(response.encodeURL(
((HttpServletRequest) pageContext.getRequest()).getRequestURI() +
"?path=" + path + "&version=" + version));
%>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="pragma" content="no-cache"/><!-- HTTP 1.0 -->
<meta http-equiv="cache-control" content="no-cache,must-revalidate"/><!-- HTTP 1.1 -->
<meta http-equiv="expires" content="0"/><!-- 0 is an invalid value and should be treated as 'now' -->
<meta http-equiv="content-language" content="en"/>
<meta name="author" content="Cedrik LIME"/>
<meta name="copyright" content="copyright 2005-2021 the Apache Software Foundation"/>
<meta name="robots" content="noindex,nofollow,noarchive"/>
<title>Sessions Administration: details for <%= currentSessionId %></title>
</head>
<body>
<% if (currentHttpSession == null) { %>
<h1><%=currentSessionId%></h1>
<% } else { %>
<h1>Details for Session <%= currentSessionId %></h1>
<table style="text-align: left;" border="0">
<tr>
<th>Session Id</th>
<td><%= currentSessionId %></td>
</tr>
<tr>
<th>Guessed Locale</th>
<td><%= JspHelper.guessDisplayLocaleFromSession(currentSession) %></td>
</tr>
<tr>
<th>Guessed User</th>
<td><%= JspHelper.guessDisplayUserFromSession(currentSession) %></td>
</tr>
<tr>
<th>Creation Time</th>
<td><%= JspHelper.getDisplayCreationTimeForSession(currentSession) %></td>
</tr>
<tr>
<th>Last Accessed Time</th>
<td><%= JspHelper.getDisplayLastAccessedTimeForSession(currentSession) %></td>
</tr>
<tr>
<th>Session Max Inactive Interval</th>
<td><%= JspHelper.secondsToTimeString(currentSession.getMaxInactiveInterval()) %></td>
</tr>
<tr>
<th>Used Time</th>
<td><%= JspHelper.getDisplayUsedTimeForSession(currentSession) %></td>
</tr>
<tr>
<th>Inactive Time</th>
<td><%= JspHelper.getDisplayInactiveTimeForSession(currentSession) %></td>
</tr>
<tr>
<th>TTL</th>
<td><%= JspHelper.getDisplayTTLForSession(currentSession) %></td>
</tr>
</table>
<form method="post" action="<%= submitUrl %>">
<div>
<input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
<input type="hidden" name="action" value="sessionDetail" />
<%
if ("Primary".equals(request.getParameter("sessionType"))) {
%>
<input type="hidden" name="sessionType" value="Primary" />
<%
}
%> <input type="submit" value="Refresh" />
</div>
</form>
<div class="error"><%= JspHelper.escapeXml(request.getAttribute("error")) %></div>
<div class="message"><%= JspHelper.escapeXml(request.getAttribute("message")) %></div>
<table style="text-align: left;" border="1" cellpadding="2" cellspacing="2">
<% int nAttributes = 0;
Enumeration<String> attributeNamesEnumeration = currentHttpSession.getAttributeNames();
while (attributeNamesEnumeration.hasMoreElements()) {
attributeNamesEnumeration.nextElement();
++nAttributes;
}
%>
<caption style="font-variant: small-caps;"><%= JspHelper.formatNumber(nAttributes) %> attributes</caption>
<thead>
<tr>
<th>Remove Attribute</th>
<th>Attribute name</th>
<th>Attribute value</th>
</tr>
</thead>
<%--tfoot>
<tr>
<td colspan="3" style="text-align: center;">
TODO: set Max Inactive Interval on sessions
</td>
</tr>
</tfoot--%>
<tbody>
<% attributeNamesEnumeration = currentHttpSession.getAttributeNames();
while (attributeNamesEnumeration.hasMoreElements()) {
String attributeName = attributeNamesEnumeration.nextElement();
%>
<tr>
<td align="center">
<form method="post" action="<%= submitUrl %>">
<div>
<input type="hidden" name="action" value="removeSessionAttribute" />
<input type="hidden" name="sessionId" value="<%= currentSessionId %>" />
<input type="hidden" name="attributeName" value="<%= JspHelper.escapeXml(attributeName) %>" />
<%
if ("Primary".equals(request.getParameter("sessionType"))) {
%>
<input type="submit" value="Remove" />
<input type="hidden" name="sessionType" value="Primary" />
<%
} else {
out.print("Primary sessions only");
}
%>
</div>
</form>
</td>
<td><%= JspHelper.escapeXml(attributeName) %></td>
<td><% Object attributeValue = currentHttpSession.getAttribute(attributeName); %><span title="<%= attributeValue == null ? "" : attributeValue.getClass().toString() %>"><%= JspHelper.escapeXml(attributeValue) %></span></td>
</tr>
<% } // end while %>
</tbody>
</table>
<% } // endif%>
<form method="post" action="<%=submitUrl%>">
<p style="text-align: center;">
<input type="submit" value="Return to session list" />
</p>
</form>
<%--div style="display: none;">
<p>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-html401"
alt="Valid HTML 4.01!" height="31" width="88"></a>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31" width="88" /></a>
<a href="http://validator.w3.org/check?uri=referer"><img
src="http://www.w3.org/Icons/valid-xhtml11"
alt="Valid XHTML 1.1!" height="31" width="88" /></a>
</p>
</div--%>
</body>
</html>