Quite simply, you can use the Java.net.URLConnection and Java.net.URL classes to open a standard HTTP connection and get a connection to the Web server. The server then transmits this information to the servlet in the usual manner. Basically, applets can be viewed as a Web browser, and the servlet does not differentiate between the 2. For the servlet, the applet is just another HTTP customer.
(You can, of course, write a servlet that is invoked specifically by your applet, in which case the servlet does know the difference of 2.) You can also open a serversocket on a client segment TCP port and let your applet open a socket connection. Then you have to design and implement a client segment Socket-level protocol to handle communications. That's what you can write about. For example, a chat applet communicates with a servlet. In short, making a client-side protocol takes more effort than HTTP, but is more flexible. However, the client protocol takes a long time to pass through the firewall. )
To see more detailed information, you can refer to the following pages:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.