Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the need of session tracking in web application?

982


What is the advantage of Servlets when compared with other server side technologies?

2305


Is servlet thread safe?

939


What are the different methods of session management in servlets?

955


Explains the differences between context.getrequestdispatcher() and request.getrequestdispatcher()?

972


Explain in brief the directory structure of a web application?

1062


What do you mean by cgi in servlet?

1031


how many jsp scripting elements are there and what are those?

975


When a servlet accepts a call from a client, it receives two objects. What are they?

1197


If a servlet is not properly initialized, what exception may be thrown?

1128


What is MIME Type?

1102


What are the steps involved in placing a servlet within a package?

1039


What is ServletConfig object?

1119


What is the main purpose of java servlets?

1012


What is the major difference between servlet and applet?

952