Question

There's getParameter() which is fine for reading a parameter I know of.

However, should I want (for lib architecture reasons) to read all the parameters that have been passed to an applet, is there a way to do it?

I've looked at the API and googled a bit, but no luck.

Was it helpful?

Solution

AFAIK you can't read in unknown parameters using the standard applet API.

Which doesn't make sense anyway. What are you going to do with unknown parameters? Care to explain why that might be useful.

A way to do it nonetheless, if you really want, is to use JavaScript and call a method defined in your applet and just pass it in the parameters.

How that works can be read up on several places. Here a few starting points:

JavaScript to Java Communication (Scripting)

Liveconnect: Calling from JavaScript to Java

Mozilla DevCenter: JavaScript to Java Communication


Regarding authors comment:

If I understood you correctly you could also enforce that every applet your lib constructs overwrites the Applet.getParameterInfo() method and returns appropriate information.

Now you could provide a static map for the parameters which the applet declared to be supported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top