I should point out the differences.  In the first non-working example I use 
'this' in my export.  In the second example I remove the 'this' and declare 
my log() method as static.

Also, I there's a typo and my string type signatures, they should be 
followed by a semi-colon, so Ljava/lang/String;

On Friday, February 14, 2014 10:51:13 PM UTC-8, rjcarr wrote:
>
> The subject sums it up pretty well, so let's get right to code:
>
> public class Main implements EntryPoint {
>  public void onModuleLoad() {
>    export();
>  }
>
>  public void log(String msg) {
>   ...
>  }
>  
>  public static native void export() /*-{
>    $wnd.log = $entry(th...@package.main::log(Ljava/lang/String));
>
>  }-*/;
>
> This doesn't work for me and I get giant stack traces in my javascript 
> logs.  I got this idea from the JSNI docs so not sure where I'm going 
> wrong.  However, if I change things to this:
>
> public class Main implements EntryPoint {
>  public void onModuleLoad() {
>    export();
>  }
>
>  public static void log(String msg) {
>   ...
>  }
>  
>  public static native void export() /*-{
>    $wnd.log = $entry(@package.Main::log(Ljava/lang/String));
>
>  }-*/;
>
> Then it works fine.  What am I doing wrong?  Thanks!
>
>

-- 
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 google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to