• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

servlet to applet communication

 
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
 
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
 
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
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic