开发者

Java embedded browser with resources in memory

开发者 https://www.devze.com 2023-01-16 23:59 出处:网络
We have a Java desktop app with an embedded browser, now using XULRunner (Firefox engine) on SWT. This browser\'s API allows us to load webs specifying an URI or its HTML content.

We have a Java desktop app with an embedded browser, now using XULRunner (Firefox engine) on SWT. This browser's API allows us to load webs specifying an URI or its HTML content. What we need is to load HTML webpages including resources but being everything in memory. The best solution would be to provide a l开发者_高级运维istener used when the engine tries to load resources so we can send it the appropriate content.

Any ideas? thank you!


It sounds like you need a small HTTP / web server. There is Jetty, there are also a few smaller ones, just search for "small java web server" or so.


In HTML 5 your can put your resources inside the HTML itself.

So you can use SWT with browser that supports HTML 5 and prepare your webpages to have resources inside HTML 5.

With SWT Browser your can simply do browser.setText(html) to load the page from memory.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号