Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet to servlet

 
anirudh takkallapally
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
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
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
http://wp.netscape.com/eng/mozilla/3.0/handbook/plugins/doc/netscape.javascript.JSObject.html
Regards,
Sanjeev
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic