我想制作grails映射模板。
这样的例子。
网址:
http://localhost:8080/controller/action/id/
我有2个gsp视图
1.Product
2.Product_create
变量id == "create"
grails会自动显示product_create,如果没有grails会显示产品。
任何人都可以解决这个问题吗?
请更正我的英文。三江源。
答案 0 :(得分:2)
类似的东西:
def product( String id ){
if( 'create' == id ) return render( view:'product_create' )
def product = doSomethingWithId()
[ product:product, ... ] // here the default "product.gsp" will be rendered
}