开发者

setContentsURL related issue

Hai,

I am using Java GWT. In this i want to load one html file.

htmlPane.setContentsURL("http://www.chellasoftapp.com/ATBrowser/images/disclaimer.html");

htmlPane.setContentsURL("images/disclaimer.html");

Which one be the faster? How is it works?

In images folder of WAR I placed that html file. Is it correct place? Or Where can i upload this?

Give suggestion for开发者_如何学运维 this issue.

Thanks in advance.

Regards, Sathya.A


This solution:

htmlPane.setContentsURL("http://www.chellasoftapp.com/ATBrowser/images/disclaimer.html");

has quite big disadventage. It doesn't work in development on local machine.

I would use

htmlPane.setContentsURL(GWT.getModuleBaseURL() + "/images/disclaimer.html");

This one always works, doesn't matter if your application is at http://www.chellasoftapp.com/ATBrowser/ or at URL root: http://www.chellasoftapp.com/

Can you put .html file into images directory? Yes you can, and technically it is still valid, however, it is not readable and not obvious. I.e. it is hard to understand for other developers.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜