wood burning stoves 2.0*
The moose likes JSP and the fly likes How to Pass ArrayList to Applet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to Pass ArrayList to Applet?" Watch "How to Pass ArrayList to Applet?" New topic
Author

How to Pass ArrayList to Applet?

Minn Myat Soe
Greenhorn

Joined: Dec 03, 2004
Posts: 3
Is there a way to pass Collections to Java Applet from a JSP or a servlet?


./Minn
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61456
    
  67

"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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Minn Myat Soe
Greenhorn

Joined: Dec 03, 2004
Posts: 3
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

Joined: Oct 18, 2000
Posts: 4121

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.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Pass ArrayList to Applet?