Read properties file using jQuery or JavaScript
One shouldn't use scriptlets in JSP, you can easily do it using struts2 tags.
Change your Javascript in JSP as follows :
function checkedRadioForDelete(f) {
var chx = document.getElementsByTagName('input');
for ( var i = 0; i < chx.length; i++) {
if (chx[i].type == 'radio' && chx[i].checked) {
var con = confirm("<s:text name="msg.confirm"/>");
if (con != true) {
} else {
f.action = "MyAction.action";
f.submit();
}
return true;
}
}
alert("<s:text name="msg.alert"/>");
return false;
}
Accessing a Properties File From a Different Project
Properties allProperties = new Properties();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
allProperties.load(loader.getResourceAsStream("/tokens.properties"));
You were close. That's indeed the right class loader, but the wrong path. Remove the leading slash.
allProperties.load(loader.getResourceAsStream("tokens.properties"));
Is there a way to display data from properties file to HTML file?
You should handle this in the backend of your application. It is explained here:
http://justinrodenbostel.com/2014/05/13/part-4-internationalization-in-spring-boot/
Additionally, try to use Spring's standard naming i.e. messages_en.properties
and messages_jp.properties
Related Topics
Require(Img Path) Not Working/ Cannot Find Module "." Reactjs
Scroll to Element from Typescript Code (Angular 5)
Stylesheet Not Loading Because Mime Type Is Text/Html
Changing the Browser Zoom Level
How Add a New Key/Value Pair to a Json Object
Browserify :- Uncaught Typeerror: Fs.Readfilesync Is Not a Function
How to Unit Test If an Element Is Visible When the *Ngif Directive Is Used Using Jasmine in Angular
Force Download a Pdf Link Using Javascript/Ajax/Jquery
How to Disable Dates Before Today in Jquery Datepicker
Easiest Way to Open a Download Window Without Navigating Away from the Page
Websocket Connection Failed: Error During Websocket Handshake: Unexpected Response Code: 400
How to Download a Base64-Encoded Image
How to Apply Count Up Function to Multiple Values on the Page
Check If a String Is a Date Value
Generate Pdf from HTML in Div Using JavaScript