Hmm....

I used to try to do something via Apache for this, but I gave up a long time ago and started handling this via a Java servlet filter and directing *.jar requests to the servlet engine. This also allows me to set jar version information in the response headers in the same servlet.

Of course, I end up using this sort of approach much of the time as (1) I have to support other web servers than just Apache and (2) writing a servlet filter is /far/ easier than attempting to write an Apache module (we don't deploy modules for Perl, PHP, etc -- and the Java servlet API is far easier for /me /to deal with than Perl, PHP, etc, anyway).

--
Jess Holle

On 10/21/2010 11:43 AM, Beer Dr. Thomas wrote:

Dear all,


to speed up our applet based application we are using the "pack200" compression for the corresponding jar-files (e.g., First.jar, see example below). The applet is hosted on Apache 2. Unfortunately we have to support "old" JREs such as JRE 1.4.2 as well. Therefore, as pack200 is not supportet in Java 1.4, the uncompressed "version" of the jar-file should be delivered if requested by a browser with Java plugin ver. 1.4.2.

I did not manage it to configure Apache according to these requirements.

Using the following configuration always (both, for JRE 1.4 and for JRE 1.6) delivers the "unpacked" jar-file (i.e., unpacked/First.jar):

httpd.conf
------------
AddType application/x-java-archive .jar
AddHandler type-map var
Options +MultiViews
MultiviewsMatch Handlers
AddEncoding pack200-gzip .jar
RemoveEncoding .gz


a) First.jar.var
-----------------
URI: First.jar

URI: packed/First.jar.pack.gz
Content-Type: x-java-archive
Content-Encoding: pack200-gzip

URI: unpacked/First.jar
Content-Type: x-java-archive


Using configuration b) instead (see below), delivers the packed (compressed) jar-file (i.e., packed/First.jar.pack.gz) for both, JRE 1.4 and JRE 1.6:

b) First.jar.var
----------------
URI: First.jar

URI: packed/First.jar.pack.gz
Content-Type: x-java-archive
Content-Encoding: pack200-gzip

What I'm doing wrong?

I really appreciate your help,

Tom


Reply via email to