Grails在外部JavaScript文件中设置来自messages.properties的错误消息
Grails Set Error Message From messages.properties In External JavaScript File
如何从消息.属性文件在外部java脚本文件上设置错误消息,以便错误消息将根据本地或英语、德语等语言自动更改。
如何在外部java脚本文件上使用<g:message code="" default="" />
或${message(code:'',default:'')}
?
在我的应用程序中,我以以下方式将模型对象传递给javascript:
<g:javascript>
// Scroll the page to the position of the add button clicked by the user
jQuery(document).ready(function() {
window.scrollBy(0, ${pageScroll});
});
</g:javascript>
在您的示例中,您可以使用标签定义一个新变量
<g:set var="tranlsatedLabel" value="${g.message(..)}"/>
你可以像我上面展示的那样通过它。
相关文章:
- javascript中对象构造函数中的var属性与this.properties
- 为什么是文档.旧版应用程序中的DOM-object.properties为null
- 定义this.properties或objectName.properties的javascript JSON对象
- How to declare a Map containing certain properties with flow
- 克服错误的更优雅的方法是什么:需要对象说明符.当通过JXA通过Messages发送SMS时,参数没有对象说明符
- javascript对象显示为null,但object.properties返回数据
- 如何在gsp页面上从javascript调用messages.properties(参数化)值
- 如何从catalina.properties获取值到jsp
- 在spring-boot中使用javascript在application.properties文件中获取值
- Javascript属性访问速度:var.properties与var[“属性”]的区别
- 如何使用ng-messages在Angularjs中显示服务器错误
- 在另一场胜利中获取Titanium.App.Properties或使其在全球范围内可用
- emberjs Computed Properties
- 通过Web脚本的javascript控制器从Alfresco的alfresco-global.properties文件中
- javascript speech.synthesis.speak properties
- Lis properties of CanvasRenderingContext2D
- 无法从struts.properties中读取某些字符串
- datatables column properties
- EmberJS:无法观察@each.properties.aother_property
- Grails在外部JavaScript文件中设置来自messages.properties的错误消息