user93353
user93353

Reputation: 14049

Launching JNLP from a dotnet web application

Oracle recommends using the JnlpDownloadServlet to launch JNLP from Java web applications - https://docs.oracle.com/javase/8/docs/technotes/guides/javaws/developersguide/downloadservletguide.html

However, I need to launch a JNLP application with a dynamically generated JNLP file from a dotnet application.

What would I need to do to enable this?

Is there anything else?

Upvotes: 5

Views: 943

Answers (2)

Shiraaz.M
Shiraaz.M

Reputation: 3191

The JNLP file is just an XML file that happens to be an executable file as long as you have Java Web Start installed on your machine. This is usually installed on a machine.

From a .NET Web Application point of view, you'd need to ensure the following:

  • Correct content-type (application/x-java-jnlp). You might need to add configuration to your .NET server to enable this mime type.
  • The file needs to be accessible via a URL (kind of obvious, but worth mentioning for completeness)
  • The file needs to be downloadable. Conceptually it is the same as returning any other file.
  • For seamlessness, the browser needs to be setup to automatically execute jnlp files. Sometimes company/default browser settings do not do this and you'd end up needing an extra click. Not a big deal, but just something to be aware of

In terms of "configuring"/implementing the actual serving of the JNLP file from a .NET Application:

  • Your end goal is that whatever JNLP file you return is executable with Java Web Start. This gives you a nice repeatable test while you're working on this.
  • You need to ensure that your .NET Application is able to serve the jar files needed by the JNLP application. Typically the codebase attribute and the resources element needs to reference your .NET application. The JNLP File Structure Page should help with this.

Upvotes: 1

Mark Wagoner
Mark Wagoner

Reputation: 1767

If you look at the JNLP servlet source code you will see that all it does is use the .jnlp file as a template and substitute place holders for specific values. There is nothing special about it that couldn't be duplicated in a .Net MVC or API controller.

Upvotes: 0

Related Questions