-1

I'm using Google Maps, now if I click on the image it should call a java method.

infowindowOpts.setContent("<img scr="bla.png"> ");
Indra
  • 692
  • 6
  • 18
user3110458
  • 374
  • 5
  • 17

2 Answers2

1

You can't call java method directly from html.

You can use JavaScript or Jquery for send ajax request to your servlet.
Servlet can call your java method and send JSON response.
again using Jquery(JavaScript) you can update your html code.

Piyush
  • 1,528
  • 2
  • 24
  • 39
0

A better way is to use GWT JSNI

You can use GWT JSNI to call Java method from JavaScript and vice-verse.

You have to just export you Java method to JavaScript. Now in Java you have full control to do anything.


Find a sample code on Calling GWT Java function from JavaScript

Community
  • 1
  • 1
Braj
  • 46,415
  • 5
  • 60
  • 76