Using JSP code in JavaScript

后端 未结 7 1418
夕颜
夕颜 2020-12-09 05:14

I want to use JSTL\'s fmt tag in JavaScript to localize my alert messages. My JavaScript file is a standalone file and when I include fmt tag in js, the file browser gives J

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 05:56

    If you are going for only alert messages just use this tag in your javascript

    Suppose you have following in your Javascript:

    alert("Confirm Deletion"); 
    

    This can be internationalized by adding bean:message tag in your javascript

    alert('');
    

    and add key value in property file

    msg.delete=Confirm Deletion
    

提交回复
热议问题