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 |
why business logic written using servlets not in jsp. Jsp used for presentation purpose. serlvet used for coding business logic and controller logic. Reason for using servlets in business logic.
What are all the protocols supported by httpservlet?
How can we create deadlock situation in servlet?
What is called Scriptlet?
What is difference between server and servlet?
How ThreadSafe page attribute will be working in Servlet as well as in JSP?Automatically ThresdSafe is true in JSP so service method will be destroy in each and every request or not?so how thresd will handle srevice method?
Elucidate servlet attributes and its scope?
Difference Between Web Server and Application server ??
What is servlet exception?
6 Answers EDS, Spa IT Solutions,
What do you mean by chaining in servlet?
when the webcontainer creates ServeletConfig,ServletContext objects? befoure creating the Servlet object or not?
Can we use threads in Servlets?