Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet to applet communication

 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--------------------------------------------------------------------------------
hi all,
I want to pass 4 arrays from my servlet to my applet.how can i do it?please reply ASAP,its urgent..........
thanks
karan
 
George Thomas
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When passing info from Applet to Servlet/ Servlet to Applet I use a "transport" container object that implements Serializable.
The arrays are fields in the container class. So I then serialize on one end and de-serialize on the other and reference anything I've defined in the container.
Hope this helps.
George.
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u please share the source code of ur program with me,if u dont mind,that would be a great help..
regards
karan
 
Shaunak Desai
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi karan,

First , you make a class that implements java.io.Serializable and then declare the 4 arrays in that class.
You can store data entered in text fields of your applets in these arrays and pass this data to your server side program, where you are using servlets.
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi shaunak,
thanks for the tip,i got a pretty good picture of the process,but the thing is that i tried doing the same but somehow got stuck up,thats why i was wondering if someone could share the code with me then it would be great..
regards
karan
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic