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

Why setMaxAge() and getMaxAge() methods are used in Cookies?

2 Answers  


Directive Include and Action Include how both are working in JSP, what is the difference between both?In which suituation we have to choose these elements?

4 Answers   AZTEC,


Define servlet mapping?

0 Answers  


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

0 Answers  


What do you mean by annotations in servlet?

0 Answers  






can i call init() method in destroy() method of servlset. ?

5 Answers   IBM,


How are filters?

0 Answers  


How servlet is created?

0 Answers  


Define the life cycle of a servlets.

0 Answers  


What is servlet exception?

6 Answers   EDS, Spa IT Solutions,


i have class files in class folder. but i have no java files. but i want to modify the java files which are related to class files . how ?

5 Answers   TCS,


What is servlet and its types?

0 Answers  


Categories