Skip to content

Instantly share code, notes, and snippets.

@SergeyAxenov
Created March 31, 2017 00:22
Show Gist options
  • Save SergeyAxenov/0c70e16d900b7b420e25cb8ba83494cf to your computer and use it in GitHub Desktop.
Save SergeyAxenov/0c70e16d900b7b420e25cb8ba83494cf to your computer and use it in GitHub Desktop.
Configures additional virtual folder in Zeppelin web server to keep web assets for Zeppelin angular apps outside of Zeppelin installation folder (i.e. when it is in a container). The main purpose is to take client side angular UI code out of zeppelin notebook and store it in normal html, js, css files
<!--
~ Configures additional virtual folder in Zeppelin web server
~ to keep web assets for Zeppelin angular apps outside of
~ Zeppelin installation folder (i.e. when it is in a container)
~ The main purpose is to take client side angular UI code out of
~ zeppelin notebook and store it in normal html, js, css files
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ 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>zeppelin-web</display-name>
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>org.apache.zeppelin.rest</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<context-param>
<param-name>configuration</param-name>
<param-value>deployment</param-value>
</context-param>
<session-config>
<cookie-config>
<http-only>true</http-only>
<secure>true</secure>
</cookie-config>
</session-config>
<!--
~ Having zeppelin web server in /zeppelin/zeppelin-web/dist/WEB-INF/web.xml
~ configures new virtual folder to keep additional zeppelin web assets outside
~ Usage:
~
~ %angular
~ <img src="/ng/logo.png"></img>
~ <div ng-inlcude="'/ng/template1.html'"></div>
~
~ to refer to files in FS outside of zeppelin installation folder:
~ /projects/acme/zeppelin-web/ng/logo.png
~ /projects/acme/zeppelin-web/ng/template1.html
-->
<servlet>
<servlet-name>ng</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
<param-name>resourceBase</param-name>
<param-value>/projects/acme/zeppelin-web/</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ng</servlet-name>
<url-pattern>/ng/*</url-pattern>
</servlet-mapping>
</web-app>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment