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

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2742288  Improved: Add global web.xml to simplify session timeout 
configuration (OFBIZ-12255)
2742288 is described below

commit 2742288bd9393afd0fdb8834b887e37efecac4a0
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Tue Jun 22 08:44:49 2021 +0200

    Improved: Add global web.xml to simplify session timeout configuration 
(OFBIZ-12255)
    
    Currently, session timeout is configured in apps separately, but session is
    shared globally, so the smallest one take effects, and it will not take 
effect
    separately for different apps.
    
    Then it is both inconvenient and confusing to increase session timeout 
value,
    as all values in those files need to be updated.
    
    A global web.xml is needed, to simplify session timeout configuration.
    
    Thanks: Xin Wang
---
 applications/accounting/webapp/accounting/WEB-INF/web.xml             | 4 ----
 applications/accounting/webapp/ap/WEB-INF/web.xml                     | 4 ----
 applications/accounting/webapp/ar/WEB-INF/web.xml                     | 4 ----
 applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml              | 4 ----
 applications/content/webapp/content/WEB-INF/web.xml                   | 4 ----
 applications/humanres/webapp/humanres/WEB-INF/web.xml                 | 4 ----
 applications/manufacturing/webapp/manufacturing/WEB-INF/web.xml       | 4 ----
 applications/marketing/webapp/marketing/WEB-INF/web.xml               | 4 ----
 applications/marketing/webapp/sfa/WEB-INF/web.xml                     | 4 ----
 applications/order/webapp/ordermgr/WEB-INF/web.xml                    | 4 ----
 applications/party/webapp/partymgr/WEB-INF/web.xml                    | 4 ----
 applications/product/webapp/catalog/WEB-INF/web.xml                   | 4 ----
 applications/product/webapp/facility/WEB-INF/web.xml                  | 4 ----
 applications/workeffort/webapp/ical/WEB-INF/web.xml                   | 4 ----
 applications/workeffort/webapp/workeffort/WEB-INF/web.xml             | 4 ----
 .../java/org/apache/ofbiz/catalina/container/CatalinaContainer.java   | 1 +
 framework/resources/templates/web.xml                                 | 4 ----
 framework/webtools/webapp/webtools/WEB-INF/web.xml                    | 4 ----
 18 files changed, 1 insertion(+), 68 deletions(-)

diff --git a/applications/accounting/webapp/accounting/WEB-INF/web.xml 
b/applications/accounting/webapp/accounting/WEB-INF/web.xml
index 6b9f534..43de3ea 100644
--- a/applications/accounting/webapp/accounting/WEB-INF/web.xml
+++ b/applications/accounting/webapp/accounting/WEB-INF/web.xml
@@ -97,10 +97,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/accounting/webapp/ap/WEB-INF/web.xml 
b/applications/accounting/webapp/ap/WEB-INF/web.xml
index 012dc92..c01205c 100644
--- a/applications/accounting/webapp/ap/WEB-INF/web.xml
+++ b/applications/accounting/webapp/ap/WEB-INF/web.xml
@@ -91,10 +91,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/accounting/webapp/ar/WEB-INF/web.xml 
b/applications/accounting/webapp/ar/WEB-INF/web.xml
index 253aee7..cb4102d 100644
--- a/applications/accounting/webapp/ar/WEB-INF/web.xml
+++ b/applications/accounting/webapp/ar/WEB-INF/web.xml
@@ -97,10 +97,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml 
b/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml
index 587bb33..0312557 100644
--- a/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml
+++ b/applications/commonext/webapp/ofbizsetup/WEB-INF/web.xml
@@ -90,10 +90,6 @@
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
diff --git a/applications/content/webapp/content/WEB-INF/web.xml 
b/applications/content/webapp/content/WEB-INF/web.xml
index a2a80e6..17f150f 100644
--- a/applications/content/webapp/content/WEB-INF/web.xml
+++ b/applications/content/webapp/content/WEB-INF/web.xml
@@ -97,10 +97,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/humanres/webapp/humanres/WEB-INF/web.xml 
b/applications/humanres/webapp/humanres/WEB-INF/web.xml
index 16c4955..d837049 100644
--- a/applications/humanres/webapp/humanres/WEB-INF/web.xml
+++ b/applications/humanres/webapp/humanres/WEB-INF/web.xml
@@ -92,10 +92,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/web.xml 
b/applications/manufacturing/webapp/manufacturing/WEB-INF/web.xml
index 32bb756..79626c3 100644
--- a/applications/manufacturing/webapp/manufacturing/WEB-INF/web.xml
+++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/web.xml
@@ -97,10 +97,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/marketing/webapp/marketing/WEB-INF/web.xml 
b/applications/marketing/webapp/marketing/WEB-INF/web.xml
index c94e2df..1329e39 100644
--- a/applications/marketing/webapp/marketing/WEB-INF/web.xml
+++ b/applications/marketing/webapp/marketing/WEB-INF/web.xml
@@ -83,10 +83,6 @@ under the License.
     <url-pattern>/control/*</url-pattern>
   </servlet-mapping>
 
-  <session-config>
-    <session-timeout>60</session-timeout><!-- in minutes -->
-  </session-config>
-
   <welcome-file-list>
     <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>
diff --git a/applications/marketing/webapp/sfa/WEB-INF/web.xml 
b/applications/marketing/webapp/sfa/WEB-INF/web.xml
index f68879a..7d074a6 100644
--- a/applications/marketing/webapp/sfa/WEB-INF/web.xml
+++ b/applications/marketing/webapp/sfa/WEB-INF/web.xml
@@ -92,10 +92,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/order/webapp/ordermgr/WEB-INF/web.xml 
b/applications/order/webapp/ordermgr/WEB-INF/web.xml
index bd39803..b279dfe 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/web.xml
+++ b/applications/order/webapp/ordermgr/WEB-INF/web.xml
@@ -104,10 +104,6 @@ under the License.
         <url-pattern>/products/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/party/webapp/partymgr/WEB-INF/web.xml 
b/applications/party/webapp/partymgr/WEB-INF/web.xml
index 0e61534..e937c6d 100644
--- a/applications/party/webapp/partymgr/WEB-INF/web.xml
+++ b/applications/party/webapp/partymgr/WEB-INF/web.xml
@@ -83,10 +83,6 @@ under the License.
     <url-pattern>/control/*</url-pattern>
   </servlet-mapping>
 
-  <session-config>
-    <session-timeout>60</session-timeout><!-- in minutes -->
-  </session-config>
-
   <welcome-file-list>
     <welcome-file>index.jsp</welcome-file>
   </welcome-file-list>
diff --git a/applications/product/webapp/catalog/WEB-INF/web.xml 
b/applications/product/webapp/catalog/WEB-INF/web.xml
index d3d2ecf..dda4674 100644
--- a/applications/product/webapp/catalog/WEB-INF/web.xml
+++ b/applications/product/webapp/catalog/WEB-INF/web.xml
@@ -106,10 +106,6 @@ under the License.
         <url-pattern>/images/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-    
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/product/webapp/facility/WEB-INF/web.xml 
b/applications/product/webapp/facility/WEB-INF/web.xml
index 2e00ad2..efaf3d2 100644
--- a/applications/product/webapp/facility/WEB-INF/web.xml
+++ b/applications/product/webapp/facility/WEB-INF/web.xml
@@ -108,10 +108,6 @@ under the License.
         <url-pattern>/ShippingAPI.dll</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/applications/workeffort/webapp/ical/WEB-INF/web.xml 
b/applications/workeffort/webapp/ical/WEB-INF/web.xml
index e77e201..2e6d794 100644
--- a/applications/workeffort/webapp/ical/WEB-INF/web.xml
+++ b/applications/workeffort/webapp/ical/WEB-INF/web.xml
@@ -95,10 +95,6 @@ under the License.
         <url-pattern>/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
diff --git a/applications/workeffort/webapp/workeffort/WEB-INF/web.xml 
b/applications/workeffort/webapp/workeffort/WEB-INF/web.xml
index 92de519..21a5ae6 100644
--- a/applications/workeffort/webapp/workeffort/WEB-INF/web.xml
+++ b/applications/workeffort/webapp/workeffort/WEB-INF/web.xml
@@ -98,10 +98,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
diff --git 
a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
 
b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
index 9f5828e..ed50d7c 100644
--- 
a/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
+++ 
b/framework/catalina/src/main/java/org/apache/ofbiz/catalina/container/CatalinaContainer.java
@@ -506,6 +506,7 @@ public class CatalinaContainer implements Container {
             ComponentConfig.WebappInfo appInfo, Configuration.Property 
clusterProp) throws ContainerException {
 
         StandardContext context = new StandardContext();
+        context.setDefaultWebXml(System.getProperty("ofbiz.home") + 
"/framework/catalina/config/web.xml");
         Tomcat.initWebappDefaults(context);
 
         String location = getWebappRootLocation(appInfo);
diff --git a/framework/resources/templates/web.xml 
b/framework/resources/templates/web.xml
index 2bccf7f..db32c1f 100644
--- a/framework/resources/templates/web.xml
+++ b/framework/resources/templates/web.xml
@@ -84,10 +84,6 @@ under the License.
     </servlet>
     
<servlet-mapping><servlet-name>ControlServlet</servlet-name><url-pattern>/control/*</url-pattern></servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
diff --git a/framework/webtools/webapp/webtools/WEB-INF/web.xml 
b/framework/webtools/webapp/webtools/WEB-INF/web.xml
index 0f6a3d5..2b7abff 100644
--- a/framework/webtools/webapp/webtools/WEB-INF/web.xml
+++ b/framework/webtools/webapp/webtools/WEB-INF/web.xml
@@ -102,10 +102,6 @@ under the License.
         <url-pattern>/control/*</url-pattern>
     </servlet-mapping>
 
-    <session-config>
-        <session-timeout>60</session-timeout><!-- in minutes -->
-    </session-config>
-
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>

Reply via email to