简体   繁体   English

使用javascript读取属性文件

[英]Read properties file using javascript

  • I have a db.properties file in my local machine with this value.我的本地机器中有一个 db.properties 文件,具有此值。
  • aaa = host,port,username,password aaa = 主机、端口、用户名、密码
  • I have a jsp page with button.我有一个带按钮的jsp页面。 On click of a button i need to read properties file value(aaa = host,port,username,password) using javascript单击按钮时,我需要使用 javascript 读取属性文件值(aaa = 主机、端口、用户名、密码)

Include the MessageResource.js from here this will solve the problem if you are using a simple javascript.如果您使用的是简单的 javascript,则从此处包含 MessageResource.js 这将解决问题。

If you are using any script framework it will contain inbuilt functionality to read .properties files.如果您使用任何脚本框架,它将包含读取 .properties 文件的内置功能。 For Example, SAPUI5 contains oBundle functionality to do this.例如,SAPUI5 包含 oBundle 功能来执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM