圣杯 1.3.5
在我的应用程序中映射到新控制器时:
"/order/$action/$id?" {
controller = "customerOrder"
}
“/order/show/13”的请求解析为“/( )/( )?/(*)?” 如日志中所示:
17:53:02 DEBUG UrlMappingsFilter - Matched URI [/order/show/13] to URL mapping [/(*)/(*)?/(*)?], forwarding to [/grails/home/page.dispatch] with response [class org.codehaus.groovy.grails.web.sitemesh.GrailsContentBufferingResponse]
如果我添加此映射:
"/order/show/13"{
controller = "customerOrder"
action = "show"
id = 13
}
它仍然解析为“/( )/( )?/(*)?”。我编辑了映射:
"/customerOrder/show/13"{
controller = "customerOrder"
action = "show"
id = 13
}
和日志报告:
18:50:08 DEBUG DefaultUrlMappingsHolder - Matched URI [/customerOrder/show/13] with pattern [/customerOrder/show/13], adding to posibilities
后来它还报告:
18:50:08 DEBUG DefaultUrlMappingsHolder - Matched URI [/customerOrder/show/13] with pattern [/(*)/(*)?/(*)?], adding to posibilities
我对这个完全感到困惑。无论哪种方式,它都解决了相同的问题。任何人的想法?