简体   繁体   中英

Run java applet directly from JAR itself on HTTP server

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM