BrowserFunction does not work in exported product [message #636774] |
Tue, 02 November 2010 17:49 |
Matt Sither Messages: 33 Registered: July 2009 |
Member |
|
|
I have an RCP app that runs an SWT Browser, which points to an embedded Jetty web server. JavaScript code in the page makes callbacks to my Java client code via an SWT BrowserFunction. This works perfectly when running the app directly from my development environment, but when I export the product and run that, then my BrowserFunctions don't get called. To prove they don't get called, I implemented a BrowserFunction called "theJavaFunction", and I also implemented a JavaScript function with the same name in the webpage. The JavaScript function simply fires an alert telling the user the function was called. When I run the exported product, the JavaScript function runs, rather than the BrowserFunction.
Oddly enough, I've tried this with a few different versions of Eclipse, and one of them produced an exported product that actually worked. Does this make any sense at all to anyone? It doesn't to me. Please help!
Thanks!
|
|
|
Re: BrowserFunction does not work in exported product [message #636951 is a reply to message #636774] |
Wed, 03 November 2010 14:04 |
Grant Gayed Messages: 2150 Registered: July 2009 |
Senior Member |
|
|
Hi,
Is your Browser Mozilla-based (ie.- you're either running on *ix, or are
creating the Browser with style SWT.MOZILLA)? Assuming it is, this
functionality relies on the Browser being able to write swt's contained
external.xpt file to a place where it can be read later by mozilla. The
location where this file needs to be written to varies between some swt
versions and platforms, so I can't suggest a specific directory to check
without knowing your OS and swt version. To investigate this on your end,
you can debug your app in eclipse after putting a breakpoint in SWT's
Mozilla class where you find string "external.xpt". You'll see the
directory that the file is to be written to, and then you can verify whether
it's there or not, and if not then hopefully you can determine the cause
(eg.- permissions problems?).
If my assumption about your Browser being Mozilla is wrong, or if you have
further questions, then please follow up.
HTH,
Grant
"Matt Sither" <sither@mit.edu> wrote in message
news:iapioo$rom$1@news.eclipse.org...
>I have an RCP app that runs an SWT Browser, which points to an embedded
>Jetty web server. JavaScript code in the page makes callbacks to my Java
>client code via an SWT BrowserFunction. This works perfectly when running
>the app directly from my development environment, but when I export the
>product and run that, then my BrowserFunctions don't get called. To prove
>they don't get called, I implemented a BrowserFunction called
>"theJavaFunction", and I also implemented a JavaScript function with the
>same name in the webpage. The JavaScript function simply fires an alert
>telling the user the function was called. When I run the exported product,
>the JavaScript function runs, rather than the BrowserFunction.
>
> Oddly enough, I've tried this with a few different versions of Eclipse,
> and one of them produced an exported product that actually worked. Does
> this make any sense at all to anyone? It doesn't to me. Please help!
>
> Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.03437 seconds