"Fossies" - the Fresh Open Source Software Archive

Member "grails-core-5.2.4/grails-docs/src/test/resources/docs/ref/Controllers/namespace.html" (14 Sep 2022, 60234 Bytes) of package /linux/www/grails-core-5.2.4.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the grails-core-5.2.4.tar.gz project site itself.

(Quick Reference)

namespace

Purpose

The namespace property is optional and defines a namespace for a controller. Multiple controllers may be defined in the same namespace. Multiple controllers may be defined with the same name as long as they are defined in separate packages and are not defined in the same namespace.

Examples

grails-app/controllers/com/app/reporting/PrintingController.groovy
package com.app.reporting

class PrintingController {

    static namespace = 'reports'

    // ...
}
grails-app/controllers/com/app/reporting/AdminController.groovy
package com.app.reporting

class AdminController {

    static namespace = 'reports'

    // ...
}
grails-app/controllers/com/app/security/AdminController.groovy
package com.app.security

class AdminController {

    static namespace = 'users'

    // ...
}

See the namespaced controllers docs for more information.