[RFC][icedtea-web] Fix handling absolute paths passed into jnlp_href's value.

Danesh Dadachanji ddadacha at redhat.com
Mon Mar 12 14:25:42 PDT 2012


Hi,

The Knuddels test applet[1] uses an absolute path to the JNLP when using 
jnlp_href. Right now we assume it's a relative path and take the 
document base (i.e. the URL of the dir in which HTML file is located) 
concatenated with the value of jnlp_href for the new URL.

The attached patch updates PluginBridge to handle absolute paths to the 
JNLP. I simply used the document base as the context to create a new 
URL. Based on the javadoc for this, if jnlp_href's value is not a 
properly formed URL, it will default to using the document base's URL as 
the base URL and append the relative part (value of jnlp_href) to the 
end of it.

The URL constructor also handles relative paths so if 
codebase="../example.jnlp", the constructor will act accordingly and 
remove a dir if possible.

+2012-03-09  Danesh Dadachanji  <ddadacha at redhat.com>
+
+	Fix to handle absolute paths passed into jnlp_href's value.
+	* netx/net/sourceforge/jnlp/PluginBridge.java
+	(PluginBridge): Use the document base as a context for the URL
+	being initialized by jnlp_href's value. This will automatically handle
+	relative and absolute URL paths.
+

Any comments? Can I push this to HEAD?

NOTE: [1] still won't work because it has invalid XML. However you 
should see that it can now find the JNLP at the correct URL as opposed to

java.io.IOException: 
http://chat.knuddels.de/http://www.knuddels.de/applet.jnlp[...]

Regards,
Danesh

[1] www.knuddels.de:8080/index.html?v=90aez&c=7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: knuddels-href-absolute-path-01.patch
Type: text/x-patch
Size: 925 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/distro-pkg-dev/attachments/20120312/f0f2fa26/knuddels-href-absolute-path-01.patch 


More information about the distro-pkg-dev mailing list