Dojo Library loading error in Worklight project when trying to access from other Machine

ぐ巨炮叔叔 提交于 2019-12-08 11:42:51

问题


I have developed a Worklight project which uses Dojo Library.After deploying project it worked fine in my local machine ,but when i tried to run the application from another PC on the same network the dojo Library host is still pointing to localhost rather than my IP Address.

How to change Dojo library host pointing to my IP Address in Worklight 6 Application.

Library path in "Page Source View" from other Machine Browser

(function(){
    var modules = { dojo: {name: "dojo", location: "http://localhost:53281/dojoLib/xxx/xxx/common/dojo"}, dijit: {name: "dijit", location: "http://localhost:53281/dojoLib/xxx/xxx/common/dijit"}, dojox: {name: "dojox", location: "http://localhost:53281/dojoLib/xxx/xxx/common/dojox"}};

Any help is appretiated.


回答1:


I figured out the problem.

In the first release of Worklight Studio V6.0, there was a problem where the hostname for the dojo library server was getting set to localhost. This caused apps that needed dojo files from the Library to fail if they that weren't running on the same host as Worklight Studio. (even apps running in emulators on the same host could run into problems) However, the latest build of Worklight Studio now selects an IP address for the dojo library server in much the same way that the IP address for the Worklight server was auto-selected in V5.




回答2:


In a standard Dojo project, the idea is that prior to deploy, the Dojo resources get added to the www folder in your Worklight project, and that needs to be done manually, so they are not accessed through Internet at all, but locally.

I recommend you see this response, that should give you an idea what I'm talking about: https://stackoverflow.com/a/18235341/2521698



来源:https://stackoverflow.com/questions/18438595/dojo-library-loading-error-in-worklight-project-when-trying-to-access-from-other

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!