BizTalk Utilities CV ,   Jobs ,   Code library
 
Go to the front page to continue learning about XML or select below:

Contents

ReBlogger Contents

Previous posts in WS, web services

 
 
Page 3044 of 19542

crossdomain.xml, Java, and JNLP

Blogger : Ajaxian Blog
All posts : All posts by Ajaxian Blog
Category : WS, web services
Blogged date : 2008 Jun 03

Joshua Marinacci has detailed how Java SE 6 update 10 supports the same crossdomain.xml that Flash supports, and how you can marry it with JNLP to allow you to do Applet mashups without permission dialogs.

The applet security model, known as the sandbox, only lets applets connect to the webserver they were loaded from. They cannot connect to anywhere else unless they are signed. Signing is great when you need access to more than what is allowed inside the sandbox, but it has two problems: the user will receive an ugly warning dialog about the applet, and the applet will have full access to the user's computer. Full access is overkill when all you want to do is talk to a webservice on another server. Surely there is some middle ground between the sandbox and full access? Well now there is.

The key is supplying a backwards compatible way of tying to the new JNLP version:

HTML:
  1.  
  2.     code="photostrip.Applet"
  3.             archive="http://projects.joshy.org/demos/PhotoStrip/webstart/PhotoStrip.jar"
  4.             width="400" height="200"
  5.            >
  6.         name="jnlp_href" value="http://projects.joshy.org/demos/PhotoStrip/photostrip.jnlp">
  7.         name="flickruser" value="31706743@N00"/>
  8.         name="size" value="100"/>
  9.         name="cols" value="4"/>
  10.         name="rows" value="2"/>
  11.    
  12.  

Now the JNLP file points to the the unsigned jar:

XML:
  1.  
  2. spec="1.0+" codebase=" " href=" ">
  3.     >
  4.         >PhotoStrip>
  5.         >Joshua Marinacci>
  6.         -allowed />
  7.     >
  8.     >
  9.         version="1.5+" href="http://java.sun.com/products/autodl/j2se" />
  10.         href="unsigned/PhotoStrip.jar" main="true" />
  11.        
  12.     >
  13.       name="PhotoStrip"
  14.       main-class="photostrip.Applet"
  15.       width="400"
  16.       height="200">
  17.   >
  18. >
  19.  

Note: you should be aware of security issues with open cross domain files.


Read comments or post a reply to : crossdomain.xml, Java, and JNLP
Page 3044 of 19542

Newest posts
 

    Email TopXML