简体   繁体   中英

glassfish applet doesn't run on server

I created a dynamic web project (week8) and simple HelloWorldApplet.I use eclipse and glassfish 4.0.when i try to run on server(r-click), server starts but browser

(http://localhost:8080/week8/WEB-INF/classes/HelloWorldApplet.java

gives this error: "HTTP Status 404 - Not Found type Status report messageNot Found descriptionThe requested resource is not available. GlassFish Server Open Source Edition 4.0" I've googled all day long, couldn't find an answer.thanks folder structure is: week8 jax-ws webservices deployment descriptor: week8 javaresoures src HelloWorldApplet.java libraries build webcontent meta-inf web-inf

You are not supposed to access applet like this, add following HTML to your page

<applet code = 'HelloWorldApplet' 
    archive = '/public/path/to/your/jar/file.jar'
    width = 300
    height = 300>
</applet>
http://localhost:8080/week8/WEB-INF/classes/HelloWorldApplet.java

There are several problems with that:

  1. It is the class ( HelloWorldApplet.class ) that needs loading, not the Java source file from which it was made.
  2. Resource under WEB-INF are not available to the general browsing public (or the client side JVM). The class needs to be loaded somewhere in the server such that if you put the address in the browser address bar and hit Enter the server would provide it (usually by offering to save it somewhere).

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