javaws : Java 7 update 45. Cannot send properties [duplicate]

限于喜欢 提交于 2019-12-11 09:48:02

问题


With the new Java 7 update 45, we are not able to set properties. We used to set it as follows

<resources>
    ...
    <jar href="xxx.jar"/>
    <property name="xxx.xxx.xxx.xxx.userName" value="Batman"/>
    <property name="xxx.xxx.xxx.xxx.locale" value="en_US"/> 
    ...
</resources>

We tried the work around, tried the following

<resources>
    ...
    <jar href="xxx.jar"/>
    <property name="jnlp.xxx.xxx.xxx.xxx.userName" value="Batman"/>
    <property name="jnlp.xxx.xxx.xxx.xxx.locale" value="en_US"/> 
    ...
</resources>

even tried "javaws." added as prefix.

Problem is we that we want to avoid making change in the codebase and want to fix the issue in the jnlp level.

Do we have any other work around or any ideas?


回答1:


According to this OpenJDK bug report (https://bugs.openjdk.java.net/browse/JDK-8023821) there are three possible workarounds:

  1. Sign the jnlp file. Use either a signed-jnlp file (JNLP-INF/APPLICATION.JNLP) or a signed jnlp template (JNLP-INF/APPLICATION_TEMPLATE.JNLP).

  2. Use secure properties. Change all the properties in the jnlp file to pre-pend "jnlp." to the property name, and modify all code to use the new properties name.

  3. Use secure properties and translate them in the main of your signed application to insecure properties. Change jnlp files to have the property names in the jnlp file pre-pended with "jnlp.myapp.", then in your application read the system properties and for each property starting with "jnlp.myapp." set the corresponding property without the "jnlp.myapp." pre-pended to the name.

It sounds like 2 and 3 are not what you want. So that leaves you with option 1. (Or accept that you need to change your codebase.)



来源:https://stackoverflow.com/questions/19571562/javaws-java-7-update-45-cannot-send-properties

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