Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想加载到 div“example_id”文件“status.gsp”中。
但应用程序拒绝访问文件“status.gsp”
$('#example_id').load('status.gsp').hide().fadeIn(3000);
不要直接加载 GSP(默认情况下,views 目录是不可见的)。通过控制器的操作对其进行路由,并将其用作 URL 以加载 GSP 呈现的 HTML。
示例:
有一个名为 的控制器StatusController,其动作名为status,它将把 GSP 渲染回输出流。
StatusController
status
class StatusController { ... def status() { render(view: "status"); } ... }