-
|
Jetty Version I'm trying to exclude mime-types from gzip-compression via <?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"https://jetty.org/configure_10_0.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="insertHandler">
<Arg>
<New class="org.eclipse.jetty.compression.server.CompressionHandler">
<Call name="putConfiguration">
<Arg>/*</Arg>
<Arg>
<Call
class="org.eclipse.jetty.compression.server.CompressionConfig"
name="builder">
<Call name="compressExcludeMimeType">
<Arg>audio/mp4</Arg>
</Call>
<Call name="compressExcludeMimeType">
<Arg>audio/ogg</Arg>
</Call>
<Call name="build" />
</Call>
</Arg>
</Call>
</New>
</Arg>
</Call>
</Configure>The error i get is: So instead of the CompressionConfig, it uses the CompressionConfig$Builder. How can i use that Builder-pattern in jetty-IOC correctly? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The problem is that You can move the creation of the configuration outside the arguments, and then reference the <Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="insertHandler">
<Arg>
<New id="CompressionHandler" class="org.eclipse.jetty.compression.server.CompressionHandler">
<!-- Prepare the configuration -->
<Call class="org.eclipse.jetty.compression.server.CompressionConfig" name="builder">
<Call name="compressExcludeMimeType">
<Arg>audio/mp4</Arg>
</Call>
<Call name="compressExcludeMimeType">
<Arg>audio/ogg</Arg>
</Call>
<!-- Store the result of the call to build() to "cfg" -->
<Call id="cfg" name="build" />
</Call>
<Call name="putConfiguration">
<Arg>/*</Arg>
<Arg>
<!-- Use the "cfg" reference -->
<Ref refid="cfg" />
</Arg>
</Call>
</New>
</Arg>
</Call>
</Configure> |
Beta Was this translation helpful? Give feedback.
The problem is that
<Call name="build" />is nested inside<Call class="org.eclipse.jetty.compression.server.CompressionConfig" name="builder">, so it is the builder that is passed as argument, and not theCompressionConfig, so you have a mismatch in the signature.You can move the creation of the configuration outside the arguments, and then reference the
CompressionConfigin this way: