diff --git a/java/org/apache/catalina/manager/HTMLManagerServlet.java b/java/org/apache/catalina/manager/HTMLManagerServlet.java index 789d539852bf..1eee1cd359e9 100644 --- a/java/org/apache/catalina/manager/HTMLManagerServlet.java +++ b/java/org/apache/catalina/manager/HTMLManagerServlet.java @@ -125,6 +125,16 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro sslConnectorCerts(request, response, smClient); } else if (command.equals("/sslConnectorTrustedCerts")) { sslConnectorTrustedCerts(request, response, smClient); + } else if (command.equals("/logout")) { + try { + request.logout(); + // Forward to logout page which will use JavaScript to clear browser credentials + request.getRequestDispatcher("/WEB-INF/jsp/logout.jsp").forward(request, response); + return; + } catch (Exception e) { + log(sm.getString("htmlManagerServlet.error.logout"), e); + message = smClient.getString("managerServlet.exception", e.toString()); + } } else if (command.equals("/upload") || command.equals("/deploy") || command.equals("/reload") || command.equals("/undeploy") || command.equals("/expire") || command.equals("/start") || command.equals("/stop")) { diff --git a/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java b/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java index c8e423fc404b..bda62458f9b7 100644 --- a/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java +++ b/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java @@ -76,6 +76,16 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro // No command == list } else if (command.equals("/list")) { // Nothing to do - always generate list + } else if (command.equals("/logout")) { + try { + request.logout(); + // Forward to logout page which will use JavaScript to clear browser credentials + request.getRequestDispatcher("/WEB-INF/jsp/logout.jsp").forward(request, response); + return; + } catch (Exception e) { + log(sm.getString("htmlHostManagerServlet.error.logout"), e); + message = smClient.getString("hostManagerServlet.exception", e.toString()); + } } else if (command.equals("/add") || command.equals("/remove") || command.equals("/start") || command.equals("/stop") || command.equals("/persist")) { message = smClient.getString("hostManagerServlet.postCommand", command); diff --git a/webapps/host-manager/WEB-INF/jsp/logout.jsp b/webapps/host-manager/WEB-INF/jsp/logout.jsp new file mode 100644 index 000000000000..b9b861455b26 --- /dev/null +++ b/webapps/host-manager/WEB-INF/jsp/logout.jsp @@ -0,0 +1,86 @@ +<%-- + 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" trimDirectiveWhitespaces="true" %> +<% + String contextPath = request.getContextPath(); +%> + + +
++ You have been successfully logged out. +
+ +Clearing session...
+ + + + diff --git a/webapps/host-manager/WEB-INF/web.xml b/webapps/host-manager/WEB-INF/web.xml index 9cc28cda94c5..3dec9f65bbbd 100644 --- a/webapps/host-manager/WEB-INF/web.xml +++ b/webapps/host-manager/WEB-INF/web.xml @@ -52,7 +52,7 @@+ You have been successfully logged out. +
+ +Clearing session...
+ + + + diff --git a/webapps/manager/WEB-INF/web.xml b/webapps/manager/WEB-INF/web.xml index 31cf2fead952..9c37d1119f5c 100644 --- a/webapps/manager/WEB-INF/web.xml +++ b/webapps/manager/WEB-INF/web.xml @@ -103,7 +103,7 @@