Java Applet - Download File with Browser -


I am trying to create a new file with a Java applet, but I do not know how to respond to this file How to Send a Browser Output, like any specific webpage

With a service it is easy with javax.servlet.http.HttpServletResponse , but is it possible with an applet?

I'm trying to do this without signing the applet or using a servlet.

Do not use an applet for it Go with the servlet.

Why do you want to do this inside the applet? It will not be able to write anything on the disk if you do not sign it, and it can only communicate with the browser through some javascript API, does not directly send a file. You can add functionality to your applets completely with Servlets, and direct the browser to any relevant page:

  AppletContext a = getAppletContext (); URL url = new URL (link_to_your_servlet); A.showDocument (URL, "_ blank");  

This will open a new window in the browser, and download the file.


Comments