United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6511202 java 6 plug-in did not set the content-type header for JARs
JDK-6511202 : java 6 plug-in did not set the content-type header for JARs

Details
Type:
Bug
Submit Date:
2007-01-09
Status:
Closed
Updated Date:
2010-11-03
Project Name:
JDK
Resolved Date:
2007-03-28
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
6u2 (b01)

Related Reports
Backport:

Sub Tasks

Description
A few years ago a colleague of mine worked with Sun to implement pack200 HTTP Compression for our applet.  Now with the release of the Java 6 Plugin we have found a problem.  To use pack200 compression with our applets, we have a special servlet which is very similar to Sun's sample servlet.  In fact, in the Java 6 Pack200 and Compression Document (http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/pack200.html)  the sample servlet code shows our problem:

        String contentType = request.getContentType();

        ...

        // Pack200 Compression
        if (encoding != null && contentType != null &&
                contentType.compareTo(JAR_MIME_TYPE) == 0 &&
                encoding.toLowerCase().indexOf(PACK200_GZIP_ENCODING) > -1){

            contentEncoding = PACK200_GZIP_ENCODING;

We have included the contentType checks in our application (which is now commercial and very widely deployed) as Sun's example indicates, and it turns out that the Java 6 Plugin is no longer setting content-type= "application/x-java-archive" in the request header, and content-type is actually null and therefore our compressed jar.pack.gz files are not getting downloaded for use with the Java 6 Plugin.
 
The Java 6 plugin breaks this sample servlet and hence our servlet too

                                    

Comments
EVALUATION

in PluginURLJarFileCallback.java, retrieve method, we need to add:

  conn.setRequestProperty("content-type", "application/x-java-archive");
                                     
2007-01-09
WORK AROUND

use JNLPDownloadServlet included in JDK samples directory
                                     
2007-01-09



Hardware and Software, Engineered to Work Together