天天看点

grails 模板

在使用grails的command来开发程序的时,经常使用的命令有

grails create-domain-class | create-controller 等

这些命令产生的 Domain 和 Controller 不是很有用,也就是说,不能够定制我们需要的

这个时候,template就起作用了

具体使用

1)

groovy 原始代码  

  1. class @artifact[email protected] {  
  2.     def index = { }  
  3. }  

修改成我么需要的就可以

java 代码  

  1. class @artifact[email protected] extends YourController{  
  2.      def index = { }  
  3. }  

这样,生产的 Domain Class就有了

使用起来