java - Unable to run Applet from Struts Web Application -
i have followed relevant tutorials, still stuck. want embed applet jsp driven struts 1.x. i've packed jar helloworld.jar
single applet helloworld.class
. hosted on local websever localhost:7001/webcontent/
. other parts of application work, , jsp loads fine without applet. when applet makes post server retrieve jar , class location, receive filenotfoundexception
, classnotfoundexception
. strange thing posts path did not expect:
network: connecting http://localhost:7001/webcontent/helloworld.jar proxy=direct network: connecting http://localhost:7001/webcontent/helloworld.jar cookie "jsessionid=ws7ljg3p3fffjl4rtcz7ylmpf68jllmgrd2jtyh7zyywlqkcqy5p!2106205894" java.io.filenotfoundexception: http://localhost:7001/webcontent/helloworld.jar @ sun.net.www.protocol.http.httpurlconnection.getinputstream(unknown source) @ sun.plugin.pluginurljarfilecallback.downloadjar(unknown source) @ sun.plugin.pluginurljarfilecallback.access$000(unknown source) network: cache entry not found [url: http://localhost:7001/webcontent/helloworld.class, version: null] network: connecting http://localhost:7001/webcontent/helloworld.class proxy=direct network: connecting http://localhost:7001/webcontent/helloworld.class cookie "jsessionid=ws7ljg3p3fffjl4rtcz7ylmpf68jllmgrd2jtyh7zyywlqkcqy5p!2106205894" network: cache entry not found [url: http://localhost:7001/webcontent/helloworld/class.class, version: null] network: connecting http://localhost:7001/webcontent/helloworld/class.class proxy=direct network: connecting http://localhost:7001/webcontent/helloworld/class.class cookie "jsessionid=ws7ljg3p3fffjl4rtcz7ylmpf68jllmgrd2jtyh7zyywlqkcqy5p!2106205894" java.lang.classnotfoundexception: helloworld.class @ sun.plugin2.applet.applet2classloader.findclass(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass0(unknown source) @ sun.plugin2.applet.plugin2classloader.loadclass(unknown source)
no matter change code, codebase, or archive parameters same request same path same failures. relevant code below:
jsp (note i've tried code="helloworld.class"
well) :
<div> <jsp:plugin type="applet" codebase="." code="helloworld" archive="helloworld.jar" width="600" height="480" /> </div>
application structure:
/ /src/ /webcontent/pages/myjsp.jsp /webcontent/pages/helloworld.jar /webcontent/web-inf/ ...
helloworld.java
import java.applet.applet; import java.awt.graphics; public class helloworld extends applet { public void init() { resize(150,25); } public void paint(graphics g) { g.drawstring("hello world!", 50, 25); } }
any appreciated.
Comments
Post a Comment