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

passing two array's to an Applet from JSP

 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on using JSP to launch an Applet to plot a curve (x,y value pairs). Currently, I use PARAM mechnism to pass name and value pairs into the Applet. It is not efficient to pass a pair one by one.
Anybody please give me some instruction on this.
Thanks in advance
Ruilin
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ruilin,
I have not done this personally, but you can try to place them into a string and then parse them once inside your applet. For example:
Data --> [1.88 2.045 3.1 4.0 5.34567]
String --> "1.88,2.045,3.1,4.0,5.34567"
Regards,
Manfred.
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Manfred,
Applet only have a method getParameter(String name), which seems to get only one value each time. It is different from servlet which has getParameterValues("name") to get multiple values.
I will do some experiment run to find out.
Thanks again,
Ruilin
 
mohana konakanchi
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I fact writing parma tag like below ex: will work fine.
<param name=dataset0yValues value="1200,200,1340,2400,500,1600">
once you get the string using getParameter("dataset0yValues"), you need to tokenize it and use each value.. This is the only solution i know.
you find any other, pl post the solution.
Mohana
 
ruilin yang
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohana,
Thanks for the response. I would like to find a way to let applet to take an array in. I do not want to hard coded in.
Do you know a way to do it ?
Thanks,
Ruilin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic