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