Currently, I am working on a Java Spring project with most of the front-end built in AngularJS, HTML, and other technologies. Within my application.properties file, I store various key-value pairs such as name, id number, password, context path, server details, UI links, and a boolean value.
name:myName
idNum:8888888888
password:squirrels
contextPath:/ilovesquirrels-ui
server:0000
ui.firstLink: www.google.com
ui.secondLink: www.yahoo.com
ui.thirdLink: www.w3schools.com
myBool: False
While the first five properties are being read automatically into an unknown location, I want to access the last four properties in JavaScript. Ideally, I would like to extract the URLs from the UI links and the boolean value and store them in JS variables. Something like:
var myLink1 = "something that accesses ui.firstLink in application.properties";
var myLink2 = "something that accesses ui.secondLink in application.properties";
var myLink3 = "something that accesses ui.thirdLink in application.properties";
Currently, I am retrieving this information from a JavaScript file containing a JSON object which duplicates the data from application.properties. However, I aim to eliminate this duplication and directly fetch the link values from the application properties file. How can I achieve this seamless retrieval process?