0
我試圖把一個javascript函數參數放入Spring消息中,並且失敗。使用javascript函數參數作爲彈簧消息標記參數
消息文件條目:
operators.delete.confirm=Are you sure you want to delete {0}?
相應的JavaScript片段:
var msg = '<spring:message code="operators.delete.confirm" arguments="${username}" javaScriptEscape="true"/>';
console.log (msg);
console.log (username);
我希望爲103
用戶名的輸出爲Are you sure you want do delete 103?
,但不被使用的參數。控制檯日誌消息的輸出是:
[19:00:14.926] Are you sure you want to delete {0}?
[19:00:14.926] 103
我哪裏出錯了?