我想做grails映射模板。
这样的例子。
网址:
http://localhost:8080/controller/action/id/
我有2 gsp的意见
1.Product
2.Product_create
当变量
id == "create"
grails会自动显示product_create,否则,grails会显示产品。
有谁能解决这个问题?
请纠正我的英语。谢谢。
最佳答案
就像是:
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
}
关于grails - Grails映射模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25720932/