karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Rathgeb <maggu2...@gmail.com>
Subject Karaf, Pax Web, Jetty, GzipHandler (compression)
Date Thu, 18 Apr 2019 09:36:14 GMT
Hi,

I would like to use gzip compression for
* my servlets registered using the "registerServlet" method of "HttpService"
* for a handler that provides static content of a directory added by jetty.xml

The programmatic registered servlets are the most important ones.
Would be nice if there is one global option to configure the default
behavior and if it is still configurable per servlet.

For the static content I am currently using that part of the jetty.xml
===
  <Get name="handler">
    <Call name="addHandler">
      <Arg>
        <New class="org.eclipse.jetty.server.handler.ContextHandler">
          <Set name="contextPath">/foo/static</Set>
          <Set name="handler">
            <New class="org.eclipse.jetty.server.handler.ResourceHandler">
              <Set name="resourceBase"><SystemProperty
name="http.base.conf" />/html-foo</Set>
              <Set name="directoriesListed">false</Set>
            </New>
          </Set>
        </New>
      </Arg>
    </Call>
    <Call name="addHandler">
      <Arg>
        <New class="org.eclipse.jetty.servlet.ServletContextHandler">
          <Set name="contextPath">/bar/static</Set>
          <Set name="resourceBase"><SystemProperty
name="http.base.conf" />/html-bar</Set>
          <Call name="addServlet">
            <Arg>org.eclipse.jetty.servlet.DefaultServlet</Arg>
            <Arg>/</Arg>
            <Call name="setInitParameter">
              <Arg>dirAllowed</Arg>
              <Arg>false</Arg>
            </Call>
          </Call>
        </New>
      </Arg>
    </Call>
  </Get>
===

Can you give me some tips / information / solution?

Best regards,
Markus

Mime
View raw message