File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes applet to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "applet to servlet" Watch "applet to servlet" New topic

applet to servlet

anirudh takkallapally

Joined: Sep 04, 2003
Posts: 14
I am doing a project in which I have to send some data from applet to the servlet , where the servlet has to invoke a process with this data , the process generates a figure , I have to display this figure to the client.
I have two questions , how do I send the data , the data basically consists of 4 ints and 3 strings, can I create an object with these and send it directly or do I need to do object serialization before sending them , I tried sending them but it did not work, if u have any working code for this I would appreciate it if u can send me other wise please guide me how to do this.
My second question is , when I am doing applet servlet communication can I display a HTML page using a servlet , that is after invoking a servlet from the applet .
I would be grateful if u can help me out here,
Yours sincerely
Anirudh Takkallapally
Sanjeev Kaushik
Ranch Hand

Joined: Aug 01, 2002
Posts: 105
You can open a URL connection in your applet to read the contents from servlet. You can get the values in key/value pair(text format) and leter convert to relevant formats.
You can display the html contents from applet, via communicating to javascript. You can use JSObject to communicate to javascript.
You can see the api of JSObject on the link below

Sanjeev Kaushik
I agree. Here's the link:
subject: applet to servlet
It's not a secret anymore!