Aug 6, 2008 3:35 AM
Best method of bidirectional communication java <-> web page?
I'd like to do 2 things
1) My java app has some data that I'd like to inject into my own custom webpage. Would the best way to do this be using evaluateScript() and call a javascript function in that custom webpage with JSON data? Then the webpage can update itself as necessary based on that new data.
2) My webpage has some data that I'd like the java app to have. This seems a bit trickier, but perhaps you can use the TitleChangeEvent? So for example the javascript on the webpage can set a javascript variable and then update the title. The java's TitleChangeEvent would fire, then execute evaluateScript() in order to retrieve the variable's data. Or maybe even I could put the data right into the title!
Would the above actually work? Is there a better way to accomplish that goal?
Thanks!