Hiroshi,
I use number 5 in my applet-servlet communications. 1 to 4 will create a URL
that is
a combination of the code base or document base plus the given URL, which
may or
may not be the correct URL for your situation. Number 6 looks invalid.
As a test take the URL from 5 and put it into the address field of a browser
to make sure it is correct.
Regards,
Rob Griffin
Quest Software
E-mail: [EMAIL PROTECTED]
Web site: http://www.quest.com
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Hiroshi Kasamatsu
> Sent: Friday, 10 November 2000 2:53
> To: [EMAIL PROTECTED]
> Subject: right URL in applet-servlet communication?
>
>
> URL object has to be created in programming applet-servlet communication.
> There are thought to be some ways.
> URL con=URL
> 1.(getCodeBase(),"http://serveradr:8181/servlet/MyServlet");
> 2.(getCodeBase(),"/servlet/MyServlet");
> 3.(getDocumentBase(),"http://serveradr:8181/servlet/MyServlet");
> 4.(getDocumentBase(),"/serlvet/MyServlet");
> 5.("http://serveradr:8181/serlvet/MyServlet");
> 6.("/serveradr:8181/MyServlet");
> Serlvet engine:jsdk2.1
> including applet:c:\jsdk2.1\webpages\Kasa\Kasa.html
> servlet class file:c:\jsdk2.1\webpages\web-inf\servlets
>
> On local machine,the result is good,but on internet,I used No1 way,only to
> fail.
> Which is right on internet environment? Or if all is right,what causes the
> difference between local and internet ?
>
> Hiroshi Kasamatsu
> [EMAIL PROTECTED]
>
> __________________________________________________________________
> _________
> 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
>
___________________________________________________________________________
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