Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Pass ArrayList to Applet?

 
Minn Myat Soe
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to pass Collections to Java Applet from a JSP or a servlet?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Minn Minn",

We're pleased to have you here with us in the JSP forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Minn Myat Soe
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sorry that I don't have any Christian name. I am known by most people as "Minn Minn". Anyway, I've changed it according to my passport name.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You *can* pass a collection into an applet from a JSP page... but you have to remember that the applet is running in the client's JVM inside their browser, while the JSP is running in the JVM on your server. So you can't pass the collection directly. If the collection is a collection of Strings (or a type easily represented by strings), you could just have code that builds the applet tag dynamically and inserts a param tag for every element in the collection. Then have the applet parse the param strings to build the collection again from the strings. If your collection is some other type, you'll need to look into some kind of distributed technology like RMI, and make the applet a RMI client. Then you can run a RMI server on your web server and pass the applet values through RMI.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic