source: installer/resources/eepsite/contexts/base-context.xml @ 3e354f2

Last change on this file since 3e354f2 was 3e354f2, checked in by zzz <zzz@…>, 3 years ago

Jetty: New default servlet for eepsite, with
locale-independent directory listing (ticket #1965)

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[92b9d0a]1<?xml version="1.0"  encoding="ISO-8859-1"?>
[9fc7258]2<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
[92b9d0a]3
4<!--
5Configure a custom context for the eepsite.
6
[50df4b5]7This context contains only a ServletContextHandler with a default servlet
[92b9d0a]8to serve static html files and images.
9-->
10
[50df4b5]11<Configure class="org.eclipse.jetty.servlet.ServletContextHandler">
[92b9d0a]12  <Set name="contextPath">/</Set>
13  <Set name="resourceBase">./eepsite/docroot/</Set>
[50df4b5]14  <Call name="setInitParameter">
[96cf1d60]15    <Arg>org.eclipse.jetty.servlet.Default.cacheControl</Arg>
[50df4b5]16    <Arg>max-age=3600,public</Arg>
[17f9280]17  </Call>
[f2a3d59]18  <Call name="setMimeTypes">
19    <Arg>
[50df4b5]20      <New class="org.eclipse.jetty.http.MimeTypes">
[f2a3d59]21        <Call name="addMimeMapping">
22          <Arg>sud</Arg>
23          <Arg>application/zip</Arg>
24        </Call>
25        <Call name="addMimeMapping">
26          <Arg>su2</Arg>
27          <Arg>application/zip</Arg>
28        </Call>
29        <Call name="addMimeMapping">
30          <Arg>xpi2p</Arg>
31          <Arg>application/zip</Arg>
32        </Call>
33      </New>
34    </Arg>
35  </Call>
[5ab17da7]36  <Call name="addServlet">
[3e354f2]37    <Arg>net.i2p.servlet.I2PDefaultServlet</Arg>
[5ab17da7]38    <Arg>/</Arg>
39  </Call>
[8243b69]40  <Call name="addFilter">
41    <!-- Add a filter to gzip on-the fly, since if we don't do it, I2P will.
42      -  This lowers the resource usage in the Java process on the client side,
43      -  by pushing the decompression out of Java and into the browser.
44      -  For all the reasons noted in the GzipFilter javadocs, this is normally
45      -  a bad idea for static content, but this is I2P.
46      -  See I2PTunnelHTTPServer for the I2P compressor.
47      -->
48    <Arg>
49      <New class="org.eclipse.jetty.servlet.FilterHolder" >
50        <Arg>
51          <New class="org.eclipse.jetty.servlets.GzipFilter" />
52        </Arg>
53        <Call name="setInitParameter">
54          <!-- minimum in Java is 1300 -->
55          <Arg>minGzipSize</Arg>
56          <Arg>512</Arg>
57        </Call>
58        <Call name="setInitParameter">
59          <!-- In Java we have a blacklist. This covers the most common cases. -->
60          <Arg>mimeTypes</Arg>
61          <Arg>application/pdf,application/x-javascript,application/xhtml+xml,application/xml,image/svg+xml,text/css,text/html,text/plain</Arg>
62        </Call>
63      </New>
64    </Arg>
65    <Arg>/*</Arg>
66    <Arg>
67      <!-- just guessing here -->
68      <Call class="java.util.EnumSet" name="of" >
69        <Arg>
70          <Call class="javax.servlet.DispatcherType" name="valueOf" >
71            <Arg>REQUEST</Arg>
72          </Call>
73        </Arg>
74      </Call>
75    </Arg>
76  </Call>
[92b9d0a]77</Configure>
78
Note: See TracBrowser for help on using the repository browser.