JNLP

Hi,

I am back with my trouble about opening jnp from vaadin.
I have one servlet that return an response on a dynamic jnlp like :

public class JNLPServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
// Set MIME type and name
response.setContentType(“application/x-java-jnlp-file”);
response.setHeader(“name”, “test.jnlp”);
response.setHeader(“Pragma”, “no-cache”);
response.setHeader(“Expires”, “0”);
response.addDateHeader(“Date”, java.util.Calendar.getInstance().getTime().getTime());
response.addDateHeader(“Last-Modified”,java.util.Calendar.getInstance().getTime().getTime());

    String xml = ....; // the content of xml is ok!

    out.print(xml);
    out.flush();
    out.close();

}

and in my application, I tried many thing like:
1/ root.open(new ExternalResource(“http://localhost:8080/test/test.jnlp”));
2/ String js = “window.location="http://localhost:8080/test/test.jnlp"\"”;
root.executeJavaScript(js);

I tried an urlconnection to get all data return by my servlet and write it in a file and the file is good!!!

But none of these solution is working, Internet explorer open a popup blocker or a message that prevent me from downloading file!

Do you have any idea to open a jnlp from a vaadin application?

Many thanks,

Adil

Your issue seems to be more with Internet Explorer settings than with Vaadin itself.
I don’t know for IE, as I rarely use it (just to check Web designs…), but I recently had JNLP support broken in Firefox, probably after upgrading to 7.0.1: it displayed the standard Windows dialog you get when you double-click a file of unknown file, asking which application to use to open it.
I found out that I had to redo the application association between the JNLP kind of file (Mime type or extension) and Java Web Start.
Perhaps you have to change your settings in a similar way.

If you are able to open an JNLP file from a plain HTML link in a test Web page, perhaps your problem is more Vaadin related, indeed.

Hi Adil, did you solve your problem abput opening jnlp from Vaadin?