在Grails 2.0中有什么新的http://grails.org/doc/2.0.0.RC1/guide/introduction.html#whats新闻
它说:
1.1.3 Web Features
Controller Actions as Methods
It is now possible to define controller actions as methods instead of using closures as in previous versions of Grails. In fact this is now the preferred way of expressing an action.
例如:
// action as a method
def index() {
}
// action as a closure
def index = {
}
Run Code Online (Sandbox Code Playgroud)
为什么这很重要?它有什么不同?
更新:我发现这个讨论谈论范围和一些非常毛茸茸的东西.http://grails.1312388.n4.nabble.com/Controller-actions-methods-or-closures-was-Re-grails-dev-Statically-typed-meta-programing-td3048287.html
我想我的问题也可能是这样:闭包对行动有什么好处?
是什么让敏捷成为比shiro更好的选择?
我现在正试图在灵活和shiro之间做出一个新的grails项目,我很好奇是什么让敏捷成为更好的选择.
我有一个带有可能包含转义 html 值的数据属性的 div
<div id="test" data-title="<script>alert("Hello");</script>"></div>
Run Code Online (Sandbox Code Playgroud)
现在,当我读取 data 属性的值时,它会自动转义。例如,以下代码将导致显示警报。
$(document).ready(function(){
$("#test").append($("#test").data("title"));
});
Run Code Online (Sandbox Code Playgroud)
见 jsfiddle http://jsfiddle.net/FJTW8/3/
为什么它没有转义,以及解决方案是什么。
有没有办法自定义标记或添加其他html元素到某些节点.
例如,我们希望在路径下所有节点的节点文本之后添加一个箭头(链接),当用户单击箭头时,打开上下文菜单.我知道可以使用右键单击打开上下文菜单,但要求是在节点后面有一个箭头并单击箭头应打开上下文菜单.
有没有办法自定义或添加其他html元素到选择性树节点,并以编程方式打开上下文菜单或链接点击事件.