In howmany ways applet-servlet communication can be done?
Answer Posted / janet
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
(u can say by using URL object open the connection to
server and get the InputStream from URL connection 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 w
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.
DataOutputStream out=new DataOutputStream9byteout);
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is the advantage of Servlets when compared with other server side technologies?
How do we go with database connection and log4j integration in servlet?
Explain how does JSP handle run-time exceptions?
How can we create deadlock situation in servlet?
What’s the difference between forward() and sendredirect() methods?
What is meant by servlet? What are the parameters of the service method?
How we can create war file in servlet?
What are the advantages of Servlet over CGI?
What is the main purpose of java servlets?
What is meant by cookies?
How is the get () method different from the post() method?
List some life cycle methods of a servlet.
What is httpservlet and how it is different from genericservlet?
What is string tokenizer?
What do you mean by filter in servlet?