Is there is a way to reuse public static final constants defined inside Java classes with the javascript files ?
Or is there a better way to define such constants so that they can be reused by both java & JavaScript ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A very simple solution would be to store your config as JSON on the server side, then have the server inject that into the HTML response to the client.
The server can read the JSON on startup and keep it in a singleton object.