In howmany ways applet-servlet communication can be done?



In howmany ways applet-servlet communication can be done?..

Answer / 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

More Servlets Interview Questions

What are the exceptions thrown by servlets? Why?

0 Answers  


Write a hello world program using servlets.

0 Answers  


What exception should be thrown when servlet is not properly initialized?

0 Answers  


How multiple simultaneous requests can be handled by servlets?

2 Answers  


Describe servlet?

0 Answers  






Explain servlet events?

0 Answers  


What is the capacity the doget can send to the server?

0 Answers  


Can a servlet be called by passing its name as a parameter in the URL?

1 Answers   iFlex,


What's the servlet interface?

0 Answers  


Which exception is thrown if the servlet is not initialized properly?

0 Answers  


What is the difference between CGI and Servlet?

0 Answers  


What is servlet mapping?

0 Answers  


Categories