aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-07-11 12:08:03 +0300
committerIttay Stern <ittay.stern@att.com>2019-07-11 11:40:39 +0000
commit5f458465bf2fb660a474e27f50bb876b3737a143 (patch)
tree7021d4a2afc0a974ffe191d6c164d0ea18efb2ed
parentb7719bae06f969d1293fad1a16c180afd7ded761 (diff)
Package webpack's `dist` folder into /app/ui
Issue-ID: VID-515 Change-Id: I33d4b5f0dbd4125a5b79253c4dc8e736df9116ee Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rwxr-xr-xepsdk-app-onap/pom.xml12
-rwxr-xr-xepsdk-app-onap/src/main/webapp/WEB-INF/web.xml59
-rw-r--r--vid-webpack-master/src/WEB-INF/web.xml8
3 files changed, 67 insertions, 12 deletions
diff --git a/epsdk-app-onap/pom.xml b/epsdk-app-onap/pom.xml
index 6bb4ffd7a..d706df669 100755
--- a/epsdk-app-onap/pom.xml
+++ b/epsdk-app-onap/pom.xml
@@ -149,7 +149,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>2.0.2</version>
+ <version>3.2.0</version>
<configuration>
<archive>
<manifest>
@@ -169,6 +169,10 @@
<groupId>org.onap.portal.sdk</groupId>
<artifactId>epsdk-app-overlay</artifactId>
</overlay>
+ <overlay>
+ <groupId>org.onap.vid</groupId>
+ <artifactId>vid-webpack-master</artifactId>
+ </overlay>
</overlays>
</configuration>
</plugin>
@@ -280,6 +284,12 @@
<type>jar</type>
<classifier>classes</classifier>
</dependency>
+ <dependency>
+ <groupId>org.onap.vid</groupId>
+ <artifactId>vid-webpack-master</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
<!-- SDK components -->
<dependency>
<groupId>org.onap.portal.sdk</groupId>
diff --git a/epsdk-app-onap/src/main/webapp/WEB-INF/web.xml b/epsdk-app-onap/src/main/webapp/WEB-INF/web.xml
index 0355fb28b..6007fdc22 100755
--- a/epsdk-app-onap/src/main/webapp/WEB-INF/web.xml
+++ b/epsdk-app-onap/src/main/webapp/WEB-INF/web.xml
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:web="http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
- version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee">
-
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+ version="3.1">
<display-name>ecomp-sdk-app-os</display-name>
<!-- The app can function on a HA cluster -->
@@ -13,6 +12,7 @@
<session-timeout>30</session-timeout>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
+
<filter>
<filter-name>SecurityXssFilter</filter-name>
<filter-class>org.onap.portalapp.filter.SecurityXssFilter</filter-class>
@@ -22,4 +22,53 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <!--
+ `vid-webpack-master` servlet and it's servlet mapping below, serves
+ Angular's index.html for any requests like the following, letting
+ the JavaScript router do its magic:
+ * /vid/app/ui/
+ * /vid/app/ui/servicePlanning
+ * /vid/app/ui/browseSdc
+ -->
+ <servlet>
+ <servlet-name>vid-webpack-master</servlet-name>
+ <jsp-file>/app/ui/index.html</jsp-file>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>vid-webpack-master</servlet-name>
+ <url-pattern>/app/ui/</url-pattern>
+ </servlet-mapping>
+
+ <!--
+ All the files under the paths below are served as static files, using
+ tomcat's `default` servlet. This overrides the `vid-webpack-master`
+ url-pattern.
+ The filter `charset-to-utf8-filter` adds "charset=UTF-8" to these files
+ content type, as the default content-type is platform-dependant (which
+ is not ok for Windows stations).
+ -->
+ <servlet-mapping>
+ <servlet-name>default</servlet-name>
+ <url-pattern>/app/ui/*</url-pattern>
+ </servlet-mapping>
+
+ <filter>
+ <filter-name>charset-to-utf8-filter</filter-name>
+ <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
+ <init-param>
+ <param-name>encoding</param-name>
+ <param-value>UTF-8</param-value>
+ </init-param>
+ <init-param>
+ <param-name>forceEncoding</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>charset-to-utf8-filter</filter-name>
+ <url-pattern>/app/ui/*</url-pattern>
+ </filter-mapping>
+
</web-app> \ No newline at end of file
diff --git a/vid-webpack-master/src/WEB-INF/web.xml b/vid-webpack-master/src/WEB-INF/web.xml
index a4152daaa..c449b34e8 100644
--- a/vid-webpack-master/src/WEB-INF/web.xml
+++ b/vid-webpack-master/src/WEB-INF/web.xml
@@ -20,10 +20,9 @@
<servlet-mapping>
<servlet-name>vid-webpack-master</servlet-name>
- <url-pattern>/app/ui/*</url-pattern>
+ <url-pattern>/app/ui/</url-pattern>
</servlet-mapping>
-
<!--
All the files under the paths below are served as static files, using
tomcat's `default` servlet. This overrides the `vid-webpack-master`
@@ -34,10 +33,7 @@
-->
<servlet-mapping>
<servlet-name>default</servlet-name>
- <url-pattern>/app/ui/css/*</url-pattern>
- <url-pattern>/app/ui/fonts/*</url-pattern>
- <url-pattern>/app/ui/img/*</url-pattern>
- <url-pattern>/app/ui/js/*</url-pattern>
+ <url-pattern>/app/ui/*</url-pattern>
</servlet-mapping>
<filter>