简体   繁体   中英

Is it possible to have 2 controllers with the same name and in different packages, grails 2.1.3

I want to create 2 controllers with the same name and in different packages, one for UI the other is REST.

Is this possible in grails 2.1.3? if yes, how?

ps: I tried and it didn't work, grails mix both controllers

Defining and mapping controllers to URLs is done by convention. So if you have the same name XController in different packages, that would lead to the same mapping - and how would you decide which controller/action to call if both just have the same?

Rename one of your controller so it makes sense for the developer (eG UiXController ) and then optionally do an url mapping if the URLs are important for some reason.

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