我正在开发一个使用大量ajax的grails应用程序。如果请求是ajax调用,则应该给出响应(此部分有效),但是如果我在浏览器中键入URL,则它应该将我带到主页/索引页面而不是请求的页面。下面是ajax调用的示例gsp代码。
<g:remoteFunction action="list" controller="todo" update="todo-ajax">
<div id ="todo-ajax">
//ajax call rendered in this area
</div>
如果我们在浏览器URL栏中输入http://localhost:8080/Dash/todo/list,控制器应该重定向到http://localhost:8080/Dash/auth/index
如何在控制器中验证这个重定向。