Passing localized javascript messages from resource bundles using JSF

后端 未结 3 1171
面向向阳花
面向向阳花 2020-12-21 02:01

I have built an application with JSF and all messages issued by the server are localized with resource bundles.

My question is: how to get messages issued in the cli

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-21 02:46

    Just let JSF print the desired JS code. E.g.

    
    

    You only need to take JS special characters such as singlequotes and newlines into account. For that, you could register a custom EL function which delegates to Apache Commons Lang StringEscapeUtils, or use OmniFaces of:escapeJS() function.

提交回复
热议问题