jnlp mime type from a serlet, but what is the href for it?
I have developed a servlet which returns a text string with mime type
"application/x-java-jnlp-file"
this launches my application in web start, but it does not load the application because
it needs a href="?.jnlp"
but there is really no file to point to.
I put the servlet reference in the href="servlet/abcJnlp?id=12&user=joe"
but that did not work.
Has anyone used "application/x-java-jnlp-file" from a servlet or JSP?
what did you use for href?
Everything works after that, but the ofline execution is not available.
Thanks
> I have developed a servlet which returns a text string
> with mime type
> "application/x-java-jnlp-file"
> this launches my application in web start, but it does
> not load the application because
> it needs a href="?.jnlp"
Who needs that?
Are you talking about the start HTML page, the one that features a link to (usually) a .jnlp file on a server?
The browser should read the HTML page, ask the URL there and should invoke web start, if it is of mime type application/x-java-jnlp-file. The suffix of the URL should not matter.
Hm, what browser do you use?
If the problem relates to the servlet, I would go for other servlet examples. Like
http://java.sun.com/products/javawebstart/docs/downloadservletguide.html
Regards,
Marc
The second part ("there is a limit ..") might help: http://www.geocities.com/vamp201/jwsfaq.html#hrefargsRegards,Marc
I am trying to create a dynamic jnlp file.
in the arguement list I put in the user name and id
so that the application running knows who started it.
I store those values in a muffin so that offline startups remember who they
are. Every user then gets at slightly different jnlp file text string.
I am having the same problem.
I am writting a servlet which will dynamically generate a JNLP file and send down to brower.
I do not want to save the JNLP file on my server. But I do not know
what I need to put in the "href=" field. I tried to put my servlet URL
there.
<jnlp spec="1.0+"
codebase="http://devone:8080/examples/servlet/"
href="LaunchJNLP">
LaunchJNLP is my servlet name.
But I got the following error from Java web start
An error occurred while launching/running the application.
Title: Test JNLP Program
Vendor: Testing
Category: Download Error
Bad MIME type returned from server when accessing resource: http://devone:8080/examples/servlet/LaunchJNLP - null
The first line of my servlet is
res.setContentType("application/x-java-jnlp-file");
If I put my real jnlp file url there, it works fine. The Java Web Start will use my real jnlp file
instead of my dynamically generated jnlp file.
Does anybody know what's wrong?
Thanks.
KC
wendxy at 2007-6-29 18:37:58 >

I had a similar problem, and it looks like the the webstart itself expexts a .jnlp file.
I am pretty sure this is what is stored in webstart so that it knows where to look for updates to the jnlp file, and it looks like they did not anticipate people using it in this fashion.
The only thing I can think of to get around this would be to generate the .jnlp file not only as an application, but also to save it off to the directory.
This should do as a workaround, and the only drawback I can see is that you have to store all the .jnlp files.
We had this kind of problem with Tomcat 4.0.1 and it was fixed with Tomcat 4.0.3 server. The problem was that Tomcat did not respond correctly to the HTTP HEAD request..
I must add this:our problem occurred in the phase when JWS was checking for latest version of the JNLP file.. And because Tomcat worked wrong with HEAD request, JWS got stuck and reported a wrong MIME type "unknown/unknown"..
I'm just curious but do you think this might work with the problem I'm having? http://forum.java.sun.com/thread.jsp?forum=38&thread=25162123 Duke dollars up for grabs!