The Source for Java Technology Collaboration

Home » java.net Forums » JDK » 6uN Early Access

Thread: javax.jnlp.* access in applets

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 6 - Last Post: May 3, 2008 11:59 AM by: brackeen Threads: [ Previous | Next ]
brackeen

Posts: 9
javax.jnlp.* access in applets
Posted: Apr 22, 2008 10:25 PM
  Click to reply to this thread Reply

In b22 applets, it looks like access to the javax.jnlp.* classes is only available if the applet has a jnlp file. Maybe there is a good reason for this. But would it be possible to allow access to these APIs even if a jnlp file isn't used?

On the surface it looks like creating a JNLP file is quite easy, but it's actually complex (I've spent at least an hour debugging one - it didn't like the name of my jnlp file, among other things). For simple applets, with fast development in mind, it would be worth avoiding.

jwenting

Posts: 478
Re: javax.jnlp.* access in applets
Posted: Apr 23, 2008 4:48 AM   in response to: brackeen
  Click to reply to this thread Reply

wow, so you can't use JNLP without having JNLP configured.
Who'd have thought?

cayhorstmann

Posts: 228
Re: javax.jnlp.* access in applets
Posted: Apr 23, 2008 8:14 AM   in response to: brackeen
  Click to reply to this thread Reply

Don't mind jwenting--he must be having a bad morning. Your question is entirely reasonable. It would indeed be desirable to have access to the JNLP API in an applet, without having to produce a JNLP file. And, yes, those files are a pain in the behind. I hope someone from Sun can weigh in on the reason.

Cheers,

Cay

kbr

Posts: 251
Re: javax.jnlp.* access in applets
Posted: Apr 30, 2008 3:54 PM   in response to: cayhorstmann
  Click to reply to this thread Reply

The implementations of several of the JNLP services require access to a "launch descriptor" which describes the origin of the app, etc. This launch descriptor is provided implicitly by the presence of the JNLP file which launched the applet and is not available for legacy applets.

I agree that creating a JNLP file by hand is a bit tedious, but we are hoping that NetBeans and other tools will help with this. There are also some simple applet examples in the new Java Plug-In's release notes which you can use as a template.

brackeen

Posts: 9
Re: javax.jnlp.* access in applets
Posted: May 1, 2008 10:06 AM   in response to: kbr
  Click to reply to this thread Reply

For simple applets, the only unique info in my JNLP (that isn't in my applet tag) is the "title" (using the jar name) the and "vendor" (using the domain name). The rest is duplicated information.

So it seems possible that an implied "launch descriptor" could be defined from the applet tag info. If you think it's technically possible, I'll file an RFE.

kbr

Posts: 251
Re: javax.jnlp.* access in applets
Posted: May 3, 2008 8:43 AM   in response to: brackeen
  Click to reply to this thread Reply

Sorry, but the clear way forward is describing applets via JNLP. There is a lot of functionality that is only enabled when you have a full JNLP descriptor available. I don't think we should spend the time on trying to make this work for older applets.

brackeen

Posts: 9
Re: javax.jnlp.* access in applets
Posted: May 3, 2008 11:59 AM   in response to: kbr
  Click to reply to this thread Reply

Okay.

In that case - how about a way to create a JNLP in javascript, like how Deployment Toolkit's deployJava.js creates the applet tag? Ideas: embedding JNLP content in the XHTML (like how inline SVG can be embedded in XHTML) or letting the jnlp_href handle a javascript: url.

Another problem I ran into is that the applet description has to be identical to the JNLP description (for example, the "java_arguments" has to be identical). If the values aren't identical, two VM instances are started - one for the initial boot and load the JNLP, another to start a VM instance with the params in the JNLP file. Obviously starting two VM instances should be avoided by the developer, since this is slower, uses more memory, shows two Java icons in the system tray, etc.

So, any way to create the JNLP in javascript could eliminate those errors, and eliminate the need to copy & paste to/from the applet tag and the JNLP file.




 XML java.net RSS