Hi,

my question "directory problem in servlet to call applet" has been solve
with help from Gurumoorthy ([EMAIL PROTECTED], [EMAIL PROTECTED]).
The solution is summaried as follows

I use jswdk1.0 in local computer to develop servlet-applet programming,
following HTML tag (for simplicity, no-converted) is sent by servlet

<APPLET CODE = JSwingTable.class WIDTH = 500 HEIGHT = 500 ALIGN = center>
</APPLET>

and JSwingTable.class is put in the same directory as the servlet, saying
.\jswdk-1.0\webpages\web-inf\servlets\. But when I use IE5.0 to start
servlet, the Java console shows

load: class JSwingTable not found.
java.lang.ClassNotFoundException: java.io.FileNotFoundException:
http://localhost:8080/servlet/JSwingTable.class
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)

The http://localhost:8080/servlet is actually
.\jswdk-1.0\webpages\web-inf\servlets\. The servlet and applet
JSwingTable.class are at the same directory. Because I could not solve this
problem, I sent a question to the list. I got a solution from Gurumoorthy.
Using following method, the problem is solve.

1) use request.getRealPath("/") to get the root directory to put the applet


2)  put java class there and use   <applet codebase="/" code
="JSwingTable.class"></applet>

Thanks again! Gurumoorthy

Regards,

Hua

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to