Is it possible to communicate from an applet to servlet and how many ways and how?
Ans: Yes, there are three ways to communicate from an applet to servlet and they are: a) HTTP Communication(Text-based and object-based) b) Socket Communication c) RMI Communication (You can say, by using URL object open the connection to server and get the InputStream from URLConnection object). Steps involved for applet-servlet communication: 1) Get the server URL. URL url = new URL(); 2) Connect to the host URLConnection Con = url.openConnection(); 3) Initialize the connection Con.setUseCatches(false): Con.setDoOutput(true); Con.setDoInput(true); 4) Data will be written to a byte array buffer so that we can tell the server the length of the data. ByteArrayOutputStream byteout = new ByteArrayOutputStream(); 5) Create the OutputStream to be used to write the data to the buffer.