Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.3, 0.4
-
Fix Version/s: 0.5.5-RC1
-
Component/s: Controllers
-
Labels:None
Description
Add support for placing controllers in sub-folders/packages within the controllers folder so you can keep related controllers together, create more structured urls and make path based url security easier?
For example:
\grails-app\controllers\SiteController.groovy -> http://localhost:8080/sample/site
\grails-app\controllers\admin\UserController.groovy -> http://localhost:8080/sample/admin/user
\grails-app\controllers\admin\RoleController.groovy -> http://localhost:8080/sample/admin/role
And views would obviously have to follow the package structure of their controller:
\grails-app\views\admin\user\show.gsp
Issue Links
| This issue relates to: | ||||
| GRAILS-376 | Organizing domain classes in subfolders |
|
|
|
| This issue is related to: | ||||
| GRAILS-376 | Organizing domain classes in subfolders |
|
|
|
During a past discussion with Graeme, one way we could support this is to allow loading of classes in subdirectories, but users will not be permitted to include a package clause. This means their class names must still be unique in the whole class graph.
The rationale for this is that importing classes (which is required if they are in packages) is anatheme to dynamic programming in essence, and service injection by name will become ugly and problematic.