This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet Servlet communication

 
Sushant Kumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how applet can fetch data from servlet which is stored in servlet in a 2D Array.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sushant,
Welcome to JavaRanch. Write the output on an ObjectOutputStream from the Servlet. Similiar to this:

Then on the Applet:

Note that any objects placed on the stream must implement java.io.Serializable
I'm moving this to the Servlet Forum.
[ February 25, 2004: Message edited by: Michael Morris ]
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from the mechanism mentioned by Michael, you can also use RMI and Socket Connection (if possible) for applet-servlet communication.
 
Harro deGouw
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using custom (raw) sockets requires special permissions, you'd have to sign the applet to get these permissions or change the security settings in the browser.
imho it's generally a better idea to use the first mechanism...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic