You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/02/15 19:31:33 UTC

[tomcat] branch 8.5.x updated (612ab4d988 -> 50342e5c80)

This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


    from 612ab4d988 Fix BZ 66429 - limit docs and examples to localhost by default
     new 47326f08d8 Include META-INF for docs web application
     new 50342e5c80 Follow-up to fix for BZ 66429 - include custom error page

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.xml                                          |  1 +
 .../jsp/404.jsp => docs/WEB-INF/jsp/403.jsp}       | 36 ++++++----------------
 webapps/docs/WEB-INF/web.xml                       |  8 ++++-
 .../jsp/404.jsp => examples/WEB-INF/jsp/403.jsp}   | 36 ++++++----------------
 webapps/examples/WEB-INF/web.xml                   |  5 +++
 5 files changed, 31 insertions(+), 55 deletions(-)
 copy webapps/{host-manager/WEB-INF/jsp/404.jsp => docs/WEB-INF/jsp/403.jsp} (51%)
 copy webapps/{host-manager/WEB-INF/jsp/404.jsp => examples/WEB-INF/jsp/403.jsp} (51%)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Follow-up to fix for BZ 66429 - include custom error page

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 50342e5c8056983765be0082d58882c8d05138cc
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Feb 15 19:28:12 2023 +0000

    Follow-up to fix for BZ 66429 - include custom error page
---
 webapps/docs/WEB-INF/jsp/403.jsp     | 44 ++++++++++++++++++++++++++++++++++++
 webapps/docs/WEB-INF/web.xml         |  8 ++++++-
 webapps/examples/WEB-INF/jsp/403.jsp | 44 ++++++++++++++++++++++++++++++++++++
 webapps/examples/WEB-INF/web.xml     |  5 ++++
 4 files changed, 100 insertions(+), 1 deletion(-)

diff --git a/webapps/docs/WEB-INF/jsp/403.jsp b/webapps/docs/WEB-INF/jsp/403.jsp
new file mode 100644
index 0000000000..e2dee6d21d
--- /dev/null
+++ b/webapps/docs/WEB-INF/jsp/403.jsp
@@ -0,0 +1,44 @@
+<%--
+  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" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <title>403 Access Denied</title>
+  <style type="text/css">
+    <!--
+    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
+    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
+    PRE, TT {border: 1px dotted #525D76}
+    A {color : black;}A.name {color : black;}
+    -->
+  </style>
+ </head>
+ <body>
+   <h1>403 Access Denied</h1>
+   <p>
+    You are not authorized to view this page.
+   </p>
+   <p>
+    By default the documentation web application is only accessible from a browser
+    running on the same machine as Tomcat. If you wish to modify this
+    restriction, you'll need to edit the documentation web applications's
+    <tt>context.xml</tt> file.
+   </p>
+ </body>
+
+</html>
diff --git a/webapps/docs/WEB-INF/web.xml b/webapps/docs/WEB-INF/web.xml
index 8920ccd756..33ae3c0dd2 100644
--- a/webapps/docs/WEB-INF/web.xml
+++ b/webapps/docs/WEB-INF/web.xml
@@ -26,4 +26,10 @@
   <description>
      Tomcat Documentation.
   </description>
-</web-app>
+
+  <error-page>
+    <error-code>403</error-code>
+    <location>/WEB-INF/jsp/403.jsp</location>
+  </error-page>
+
+</web-app>
\ No newline at end of file
diff --git a/webapps/examples/WEB-INF/jsp/403.jsp b/webapps/examples/WEB-INF/jsp/403.jsp
new file mode 100644
index 0000000000..406f7543f1
--- /dev/null
+++ b/webapps/examples/WEB-INF/jsp/403.jsp
@@ -0,0 +1,44 @@
+<%--
+  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" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+  <title>403 Access Denied</title>
+  <style type="text/css">
+    <!--
+    BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}
+    H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
+    PRE, TT {border: 1px dotted #525D76}
+    A {color : black;}A.name {color : black;}
+    -->
+  </style>
+ </head>
+ <body>
+   <h1>403 Access Denied</h1>
+   <p>
+    You are not authorized to view this page.
+   </p>
+   <p>
+    By default the examples web application is only accessible from a browser
+    running on the same machine as Tomcat. If you wish to modify this
+    restriction, you'll need to edit the example web application's
+    <tt>context.xml</tt> file.
+   </p>
+ </body>
+
+</html>
diff --git a/webapps/examples/WEB-INF/web.xml b/webapps/examples/WEB-INF/web.xml
index ff394c0566..a40e084f21 100644
--- a/webapps/examples/WEB-INF/web.xml
+++ b/webapps/examples/WEB-INF/web.xml
@@ -415,4 +415,9 @@
         <listener-class>websocket.drawboard.DrawboardContextListener</listener-class>
     </listener>
 
+    <error-page>
+        <error-code>403</error-code>
+        <location>/WEB-INF/jsp/403.jsp</location>
+    </error-page>
+
 </web-app>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Include META-INF for docs web application

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 47326f08d853eed56bd589f6325438f97ea4f469
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Feb 15 19:28:37 2023 +0000

    Include META-INF for docs web application
---
 build.xml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/build.xml b/build.xml
index 5a3a72c822..d407be0407 100644
--- a/build.xml
+++ b/build.xml
@@ -1025,6 +1025,7 @@
     <copy todir="${tomcat.build}/webapps">
       <fileset dir="webapps">
         <include name="docs/images/**"/>
+        <include name="docs/META-INF/**"/>
         <include name="docs/WEB-INF/**"/>
         <include name="docs/appdev/*.txt"/>
         <include name="docs/appdev/sample/**"/>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org