【发布时间】:2014-01-29 10:36:17
【问题描述】:
我的代码是这样的:
${remoteFunction(controller:'user', action:'clearCache',
params:'\'&cacheUserId=\' + cacheUserId + \'&pageName=\' + pageName',
onSuccess: 'onSuccess()',
onFailure: 'onFailure()') };
在我的控制器操作方法中
clearCache(){
def status = getBusiness(); // this method returns boolean only.
if(status==true){
render "Success"}
else render "Failure"
}
新它总是调用 onSuccess() javascript 函数。
所以我删除了 else 块,然后它不会在状态为 false 的情况下调用 onFailue/onSuccess。
我能知道 onFailure 什么时候会调用吗,如果状态为假,我该如何调用它。
【问题讨论】: