简体   繁体   中英

How to Change Controller Name URL in Grails?

I'm trying to change default convention of controller name in Grails. My Controller Class is named LongNameInCamelCaseController . Grails convention over configuration sets an url mapping for this controller like longNameInCamelCase . I want this controller name in url friendly 'long-name-in-camel-case' .

Someone already do this?

Thanks.

That's described in the docs here: http://grails.org/doc/latest/guide/theWebLayer.html#customizingUrlFormat

Add

grails.web.url.converter = 'hyphenated'

in Config.groovy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM