问题
I do not understand the purpose of the properties listed in worklight.properties:
- publicWorkLightHostname
- publicWorkLightProtocol
- publicWorkLightPort
Those properties are set when you do in eclipse the Run As -> "Build settings and deploy target..."
Are they duplicated? Which one is the valid one? Are they used in different ways?
I have read the documentation in info center:
https://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/index.jsp?topic=%2Fcom.ibm.worklight.deploy.doc%2Fadmin%2Fr_configuring_the_ibm_worklight_server_location.html
But there is no mention to the "Build settings and...".
回答1:
See this question and answer: worklight server configuration - separating adapters and server
The properties that are found in worklight.properties relate to the Worklight Server. The properties you have mentioned:
publicWorklightHostname
,publicWorklightPort
,publicWorklightProtocol
, are required because the server itself needs to know what is its URL to the outside world, so that it can embed it in redirects and such. These are also required for the Mobile Web, Desktop Browser environments and Worklight Console.
For example:
Create a new application and add the Mobile Web environment > Run on Worklight Development Server deploy. Open Worklight Console and click on "Get application URL". Copy the URL. Go to worklight.properties, change the publicWorklightPort
to "100"; Go back to console, compare the previous URL with the current.
From Javier:
They are not used by the mobile apps. They are shipped with the .war and are used by the .war to provide information to the user like the web url, but the server does not use them for the execution of a mobile app.
来源:https://stackoverflow.com/questions/23793586/ibm-worklight-6-1-when-are-these-properties-used-publicworklighthostname-prot