6.1 Controllers

A controller handles requests and creates or prepares the response and is request-scoped.  In other words a new instance is created for each [request|controllers]. A controller can generate the response or delegate to a view. To create a controller simply create a class whose name ends with @Controller@ and place it within the @grails-app/controllers@ directory.
一个控制器(Controllers)是请求范围的,用于处理请求,创建或者准备响应。换句话说,每次[request|controllers]会创建一个新的控制器(Controllers)实体。一个控制器(Controllers)能产生响应或者委托给一个视图。创建一个控制器(Controllers),简单创建一个类名以 @Controller@ 结尾的类,并放于@grails-app/controllers@目录中。
The default [URL Mapping|guide:mapping] setup ensures that the first part of your controller name is mapped to a URI and each action defined within your controller maps to URI within the controller name URI.
默认的[URL Mapping|guide:mapping]设置能确保你的控制器(Controllers)名字的第一部分被映射到一个URI上,并且控制器(Controllers)中的每个Actions(操作)定义被映射到控制器(Controllers)命名URI中的URI。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值