I want to access a system property from my .js file.
Initially I had accessed the system property from my jsp file using the below syntax which worked just fine:
<script type="text/javascript">
function ChatWindow(){
var property = "<%=System.getProperty("CHAT_WINDOW_URL") %>";
alert(property);
}
</script>
However when I tried to use the same function in .js file, I am getting errors that :
Expected ';'
When I do add ';' as follows:
var property = "<%=System.getProperty("CHAT_WINDOW_URL"); %>";
or as
var property = "<%=System.getProperty('CHAT_WINDOW_URL') %>";
The error goes.. but the property value is not resolved. Could anybody please help me on this.
.jsfile. Why not just revert back to setting the JS variable in your JSP file?jspfile instead ofjsand include it in rest of the files. This will solve your issue.