1

I have applet that contains method:

public void send(byte[] arr) {
   ... //some code
}

But when I call this method from JS I get the error:

java.lang.IllegalArgumentException: No method found matching name send and arguments [sun.plugin2.main.client.MessagePassingJSObject]

If I set send method argument to String and then pass string argument from JS to applet, then it`s ok. No warnings.

How to pass array from JS to java method correctly?

2

1 Answer 1

1

http://docs.oracle.com/javase/tutorial/deployment/applet/invokingAppletMethodsFromJavaScript.html contains some examples.

Javascript does not have a byte type, at least not in the browser. Try passing in an the arguments as int[] or String[] and casting/converting in your applet to a byte array.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.