Applet-Server Communication
If I understand Applets correctly, I believe it is a reference in the page to the applet file on the server, which is then loaded into the user's internet browser.
So, what if you want to have the Applet obtain information from the server? If it is operating in the user's browser on the user end, you can't use a local URL reference right?
Do you need to use a servlet?
Any help is appreciated. Thanks in advance!
Re: Applet-Server Communication
Quote:
Do you need to use a servlet?
No, a servlet is not needed. Of course it depends on your application if it needs the servlet. I've used a perl cgi-bin to provide server side services.
Re: Applet-Server Communication
But, how can you refer directly to a location on the server-side file system if the applet gets loaded into the client's browser?
Re: Applet-Server Communication
You don't refer directly to a location on the server side. You ask some code on the server side to do something for you. That could include asking it to read a file on the server or from another server or ...
Re: Applet-Server Communication
Yeah, but... what I'm trying to ask is how do you access that code?
Re: Applet-Server Communication
What protocols and what ports does the server listen on?
For example
HTTP on 80 => Use Socket or HTTPURLConnection classes to send a GET/POST request
FTP on 25 ? => Use Socket with the FTP protocol
Re: Applet-Server Communication
Quote:
Originally Posted by
Norm
What protocols and what ports does the server listen on?
For example
HTTP on 80 => Use Socket or HTTPURLConnection classes to send a GET/POST request
FTP on 25 ? => Use Socket with the FTP protocol
This is theoretical. No plan has been drawn yet for anything.
I don't know. This isn't an area I'm an expert on. Would you happen to have any suggestions?
I could see using a HttpUrlConnection to access URLs on the server side perhaps?
Re: Applet-Server Communication