惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
G
Google Developers Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
腾讯CDC
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
Last Week in AI
Last Week in AI
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Martin Fowler
Martin Fowler
A
About on SuperTechFans
博客园 - 叶小钗

博客园 - 页面载入出错

Grails指南摘要-403-生命周期 Grails指南摘要-402-logging Grails指南摘要-307-测试领域类 Grails指南摘要-306-嵌入式对象 Grails指南摘要-305-扩展和继承 Grails指南摘要-304-对象关系 Grails指南摘要-303-自定义对象映射 Grails指南摘要-302-瞬时属性 Grails指南摘要-301-属性验证 20130527-jQuery in actin-看代码说事-ch01 20130518-Grails In Action-5、控制应用程序流(04小节) 20130518-Grails In Action-5、控制应用程序流(03小节) 20130517-Grails In Action-5、控制应用程序流(02小节) 20130517-Grails In Action-5、控制应用程序流(01小节) 20130517-Grails In Action-4、让模型工作(06小节) 20130516-Grails In Action-4、让模型工作(05小节) 20130516-Grails In Action-4、让模型工作(04小节) 20130516-Grails In Action-4、让模型工作(03小节) 20130516-Grails In Action-4、让模型工作(02小节)
Grails指南摘要-401-Controller中设置默认Action
页面载入出错 · 2013-06-04 · via 博客园 - 页面载入出错

Controller中默认的Action是index,可以通过defaultAction指定默认的Action

// Here the 'list' action is the default as there is only one action defned
class SampleController {
    def list() {}
}

这个Controller中只有一个list Action,访问时需要定向到list才能访问到有效路径

// In this example 'index' is the default by convention
class SampleController {
    def list() {}
    def index() {}
}

这个Controller中有index和list两个action,系统会默认index为默认

// Here 'list' is explicitly set as the default
class SampleController {
    static defaultAction = 'list'
    def list() {}
    def index() {}
}

这个Controller中有两个action并指定list为默认,则系统会定向到list,并且在浏览器路径中不显示具体路径