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 some disadvantages of storing session state in cookies?

0 Answers  


What are the life-cycle methods for a servlet?

0 Answers  


What is the difference between servlet config and servlet context.

19 Answers   TCS, Tech Mahindra, Vertex,


What is lazy loading and what is Generic Servlet Class?

0 Answers  


What are different types of Servlets?

12 Answers  






What is the difference between doGet and doPost?

9 Answers   iGate,


what is session tracking?what are types of session tracking ?and when to cookies,when to use sessionmanagement,whent use url rewriting technique,plz explain briefly?

6 Answers   Satyam, TCS,


How do you invoke a servelt?

0 Answers  


Is servlet a server side scripting language?

0 Answers  


Can threads be used in Servelet?

3 Answers  


Define context initialization parameters.

0 Answers  


How will two or three servlets interact or communicate with each other?

0 Answers  


Categories