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 |
How to get the path of servlet in the server?
What is a servlet context object?
What are different ways for servlet authentication?
What are the objects involved when a servlet receives a call from client?
Should I override the service() method?
What do you mean by web applications? Explain web application directory arrangement?
what are the disadvantages of cookies?
Explain url encoding?
Which are the different ways you can communicate between servlets?
Difference between doget and dopost?
What is servlet? Explain
Why the concept of single thread model interface is used?