Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question
1  
    
@Mob there is no answer to my question on that page. –  hello_amigo Jul 17 '12 at 10:08

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.