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 |
What are the disadvantages of storing session state in cookies?
Can we use threads in Servlets?
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?
What is HTTP Session ?
Why do you use session tracking in httpservlet?
how to make the IP address to .com
Explain url encoding in servlet?
How can we implement a jsp page?
What is the difference between CGI and Servlet?
What is the default HttpRequest method?
When we don't write any constructor for the servlet, how does container create an instance of servlet?
Explain the jar and war files in servlet?