In howmany ways applet-servlet communication can be done?
Answer Posted / 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 View All Answers
Is servlet a server side scripting language?
What is the use of welcome-file-list?
what is the different between a servlet and a cgi? Why do you go for servlet rather than cgi?
Can servlet have a constructor ?
What is the use of send redirect () method?
request parameter how to find whether a parameter exists in the request object?
What do you mean by cgi and what are its drawbacks?
Why servlet is mostly used?
Differentiate between the get and post method
Explain their methods? Tell me their parameter names also have you used threads in servlet?
Why is init() method is used in servlets?
What is the purpose of dispatcherservlet properties?
What do you mean by servlet context?
how to link html file to sevlet file.one name is textbox,c&c++ is cheakbox,bc&mca is radio button and one submit buttonis ok why in this programme use in servelt file
How can we refresh automatically when new data has entered the database?