我有
def exception = request.exception.stackTraceLines
在Groovy Controller 中。如何在JavaScript中获取
exception
的值。
最佳答案
如果您要将异常(exception)添加到这样的返回中。
flash.message = message(exception: 'Error: xxx');
你可以这样得到
<div class="message" role="status"> ${flash.message} </div>
只需使用$ {您的flash.your_var_name}
关于grails - 如何在JavaScript中使用groovy Controller 元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12783794/