Grails
  1. Grails
  2. GRAILS-9300

Add "package" attribute to UrlMappingInfo

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.4
    • Fix Version/s: None
    • Component/s: URL mappings
    • Labels:

      Description

      I think the limitation of UrlMappingInfo is a real issue. It chooses a controller by name only. What if a "package" name was an additional parameter? It could be optional and remain completely backwards compatible.

      By being able to specify the package name, you could solve many issues.

      • You could define a UrlMapping path for all controllers in a certain package:
        "/admin/$controller/$action?/$id?"(package:"my.example.admin")
      • You could use constraints to specify that the package name must start with my.plugin.
      • If there were naming collisions where multiple controllers had the same name, you would have recourse to resolve them in your mapping by specifying the package name.

      And if you left the package name unspecified, the controllers would continue to be resolved as they are today.

        Issue Links

          Activity

          Hide
          Jeff Scott Brown added a comment -

          Some notes about the support we are building to help provide improved namespace support for controllers are available at https://github.com/grails/grails-core/wiki/Artifact-Namespaces.

          Show
          Jeff Scott Brown added a comment - Some notes about the support we are building to help provide improved namespace support for controllers are available at https://github.com/grails/grails-core/wiki/Artifact-Namespaces .

            People

            • Assignee:
              Unassigned
              Reporter:
              Jim Slattery
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Development