开发者

How can I get read all the parameters of an applet?

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 hav开发者_高级运维e 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜