You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2019/01/02 14:58:48 UTC

[myfaces-tobago] branch master updated: fix docker-tomcat-container

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

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new a4b4e94  fix docker-tomcat-container
a4b4e94 is described below

commit a4b4e947623c57987a88c0f64c36d6e7cd8f3908
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Wed Jan 2 15:57:50 2019 +0100

    fix docker-tomcat-container
---
 tobago-example/tobago-example-demo/pom.xml         |  26 ++-
 .../src/main/docker-tests/tomcat/override-web.xml  | 198 +++++++++++++++++++++
 2 files changed, 223 insertions(+), 1 deletion(-)

diff --git a/tobago-example/tobago-example-demo/pom.xml b/tobago-example/tobago-example-demo/pom.xml
index 518725d..8d0b7d3 100644
--- a/tobago-example/tobago-example-demo/pom.xml
+++ b/tobago-example/tobago-example-demo/pom.xml
@@ -769,6 +769,28 @@
     </profile>
 
     <profile>
+      <id>docker-tomcat</id>
+      <build>
+        <finalName>${finalName}</finalName>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-war-plugin</artifactId>
+            <configuration>
+              <webXml>src/main/docker-tests/tomcat/override-web.xml</webXml>
+              <webResources>
+                <resource>
+                  <targetPath>src</targetPath>
+                  <directory>${basedir}/src/main/java</directory>
+                </resource>
+              </webResources>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+
+    <profile>
       <id>docker-qunit-tests</id>
       <build>
         <plugins>
@@ -778,7 +800,7 @@
             <version>${exec.version}</version>
             <executions>
               <execution>
-                <phase>generate-sources</phase>
+                <phase>package</phase>
                 <goals>
                   <goal>exec</goal>
                 </goals>
@@ -787,6 +809,7 @@
                   <arguments>
                     <argument>clean</argument>
                     <argument>package</argument>
+                    <argument>-Pdocker-tomcat</argument>
                   </arguments>
                 </configuration>
               </execution>
@@ -824,6 +847,7 @@
                         <executable>mvn</executable>
                         <arguments>
                           <argument>package</argument>
+                          <argument>-Pdocker-tomcat</argument>
                           <argument>-Djsf=@item@</argument>
                           <argument>-DfinalName=tobago-example-demo-@item@</argument>
                         </arguments>
diff --git a/tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml b/tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml
new file mode 100644
index 0000000..b003228
--- /dev/null
+++ b/tobago-example/tobago-example-demo/src/main/docker-tests/tomcat/override-web.xml
@@ -0,0 +1,198 @@
+<?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.
+-->
+
+<web-app
+    xmlns="http://java.sun.com/xml/ns/javaee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+    version="3.0">
+
+  <display-name>Tobago Demo Application</display-name>
+
+  <!-- for jetty also check src/test/jetty/override-myfaces-web.xml or src/test/jetty/override-mojarra-web.xml -->
+  <context-param>
+    <param-name>javax.faces.PROJECT_STAGE</param-name>
+    <!--<param-value>Development</param-value>-->
+    <param-value>Production</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>com.sun.faces.validateXml</param-name>
+    <param-value>true</param-value>
+  </context-param>
+
+<!-- enable for websockets -->
+  <context-param>
+    <param-name>javax.faces.ENABLE_WEBSOCKET_ENDPOINT</param-name>
+    <param-value>true</param-value>
+  </context-param>
+
+   <!-- disable error handling from myfaces, needed for the demo -->
+  <context-param>
+    <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
+    <param-value>false</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
+    <param-value>true</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>javax.faces.FACELETS_VIEW_MAPPINGS</param-name>
+    <param-value>*.xhtml</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
+    <param-value>true</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
+    <param-value>true</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</param-name>
+    <param-value>20</param-value>
+  </context-param>
+
+  <context-param>
+    <param-name>org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION</param-name>
+    <param-value>4</param-value>
+  </context-param>
+
+  <listener>
+    <listener-class>org.apache.myfaces.tobago.example.demo.info.ActivitySessionListener</listener-class>
+  </listener>
+
+  <!-- activate this for some containers -->
+  <!--
+  <listener>
+    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+  </listener>
+  -->
+
+  <!-- activate this for some containers -->
+  <listener>
+    <listener-class>org.apache.webbeans.servlet.WebBeansConfigurationListener</listener-class>
+  </listener>
+
+  <filter>
+    <filter-name>LoggingMdcFilter</filter-name>
+    <filter-class>org.apache.myfaces.tobago.internal.webapp.LoggingMdcFilter</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>LoggingMdcFilter</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
+
+  <!-- FacesServlet -->
+
+  <servlet>
+    <servlet-name>FacesServlet</servlet-name>
+    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+    <load-on-startup>3</load-on-startup>
+    <!-- This is needed, for file upload e.g. <tc:file> with JSF 2.0 or 2.1.
+     Version JSF 2.2 or higher doesn't need it! -->
+    <multipart-config>
+      <max-file-size>1000000</max-file-size>
+      <max-request-size>20000000</max-request-size>
+    </multipart-config>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>FacesServlet</servlet-name>
+    <url-pattern>*.xhtml</url-pattern>
+  </servlet-mapping>
+
+  <servlet>
+    <servlet-name>OldLinksServlet</servlet-name>
+    <servlet-class>org.apache.myfaces.tobago.example.demo.OldLinksServlet</servlet-class>
+  </servlet>
+
+  <servlet-mapping>
+    <servlet-name>OldLinksServlet</servlet-name>
+    <url-pattern>/faces/*</url-pattern>
+  </servlet-mapping>
+
+  <!-- Error handling, see also these classes:
+       org.apache.myfaces.tobago.example.demo.TobagoExceptionHandler
+       org.apache.myfaces.tobago.example.demo.DeltaSpikeClientWindowConfig
+   -->
+
+  <error-page>
+    <error-code>404</error-code>
+    <location>/error/404.xhtml</location>
+  </error-page>
+
+  <error-page>
+    <error-code>500</error-code>
+    <location>/error/exception.xhtml</location>
+  </error-page>
+
+  <error-page>
+    <exception-type>java.lang.Exception</exception-type>
+    <location>/error/exception.xhtml</location>
+  </error-page>
+
+  <!-- The Usual Welcome File List -->
+  <welcome-file-list>
+    <welcome-file>init.xhtml</welcome-file>
+  </welcome-file-list>
+
+  <session-config>
+    <!-- for WebSphere you need to comment out this block, because WebSphere want to set it himself -->
+    <cookie-config>
+      <http-only>true</http-only>
+      <!-- with secure=true you can only use https, not http -->
+      <!--<secure>true</secure>-->
+    </cookie-config>
+  </session-config>
+
+  <security-constraint>
+    <display-name>Security Constraint</display-name>
+    <web-resource-collection>
+      <web-resource-name>Application Area</web-resource-name>
+      <url-pattern>/content/30-concept/80-security/20-roles/*</url-pattern>
+    </web-resource-collection>
+    <auth-constraint>
+      <role-name>demo-admin</role-name>
+      <role-name>demo-guest</role-name>
+    </auth-constraint>
+  </security-constraint>
+
+  <login-config>
+    <auth-method>FORM</auth-method>
+    <realm-name>demo-realm</realm-name>
+    <form-login-config>
+      <form-login-page>/login.xhtml</form-login-page>
+      <form-error-page>/login.xhtml</form-error-page>
+    </form-login-config>
+  </login-config>
+
+  <security-role>
+    <role-name>demo-admin</role-name>
+  </security-role>
+  <security-role>
+    <role-name>demo-guest</role-name>
+  </security-role>
+
+</web-app>