Yes, but that was not the question. I'd like to be able to invoke methods 
from the Java String implementation. The code above is meant just as an 
example for the error I get.

On Friday, February 15, 2013 2:26:43 PM UTC+1, Patrick Tucker wrote:
>
> Does str < "test" not get the result you want?
>
> On Friday, February 15, 2013 5:53:58 AM UTC-5, alucard wrote:
>>
>> This does not work:
>>
>> private static native int test(String str) /*-{
>>    return [email protected]::compareTo(Ljava/lang/String;)("test");
>> }-*/;
>>
>> It dies with the following exception:
>>
>> com.google.gwt.core.client.JavaScriptException: (Error) 
>> @test.client.Test::test(Ljava/lang/String;)([string: 'hello']): Error 
>> calling method on NPObject.
>> at 
>> com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:249)
>> at 
>> com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
>> at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:571)
>>
>> Is it possible (if yes please write how) to invoke String methods from 
>> JSNI?
>>
>> Thanks for the help.
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to