Reputation: 506
I have the following problem.
I have one JAR file, which includes Main.class
and Applet.class
. In the Main.class I run HTTP server on port 8888, where is set my handler for com.sun.net.httpserver.HttpHandler
. I want to do the following: I want to set Headers Content-Type to Java Applet, so don't send some HTML code, but send the Applet.class to run in the browser. It means, if someone will open the IP address with port 8888, it sends him request to run Applet.class, but it won't send him any HTML. Is this somehow possible?
Could this be solved by Java (.jsp) pages?
Upvotes: 0
Views: 390
Reputation: 17784
No. A browser will not run an applet without an HTML page.
You could write a Java client app that downloads and runs your applet without any HTML, or you could use Java Web Start.
Upvotes: 2