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

Explain in detail about applet to servlet communication?

1 Answers  


What are the ways to handle multi-threading in servlets?

0 Answers  


What is the difference between callling a RequestDispatcher using ServletRequest and ServletContext?

2 Answers  


Tell us something about servletcontext interface.

0 Answers  


How to upload a file to the server using servlet?

0 Answers  






How to find whether a parameter exists in the request object?

0 Answers  


What is forward() and include() of servlets RequestDispatcher interface?

6 Answers   HCL,


difference between forward and sendredirect

6 Answers   Accenture,


How can a servlet refresh automatically if some new data has entered the database?

3 Answers   Citi Bank, CitiGroup, IBM, Satyam,


Name the webserver that is used to run Servlets?

5 Answers  


What is with the javax.servlet package naming?

2 Answers  


What is the difference between the include() and forward() methods?

0 Answers  


Categories