Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0 final
-
Component/s: Controllers
-
Labels:None
Description
If you have more than one public method of the same name in a controller, you get an error like this:
| Compiling 1 source files.
| Error Compilation error: startup failed:
/Users/pledbrook/dev/projects/scratch/tmp20/grails-app/controllers/tmp20/TestController.groovy: 5: Repetitive method name/signature for method 'java.lang.Object tokenStr()' in class 'tmp20.TestController'.
@ line 5, column 4.
def tokenStr() {
^
/Users/pledbrook/dev/projects/scratch/tmp20/grails-app/controllers/tmp20/TestController.groovy: -1: Repetitive method name/signature for method 'java.lang.Object tokenStr()' in class 'tmp20.TestController'.
@ line -1, column -1.
2 errors
As methods are actions, it makes sense that you should only be allowed one method with such a name (although it this is the case, we should document it). But then the error should be far more informative, i.e. it should say that you can't have more than one public method with the name in a controller because they are treated as actions.
Just try to compile the attached bug report to see the error.
-
Hide
- tmp20-bug-report-23012012.zip
- 23/Jan/12 6:57 AM
- 22 kB
- Peter Ledbrook
-
- grails-app/.../ApplicationResources.groovy 0.1 kB
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/BuildConfig.groovy 2 kB
- grails-app/conf/Config.groovy 4 kB
- grails-app/conf/DataSource.groovy 1 kB
- grails-app/conf/UrlMappings.groovy 0.2 kB
- grails-app/conf/spring/resources.groovy 0.0 kB
- grails-app/.../TestController.groovy 0.2 kB
- grails-app/i18n/messages.properties 3 kB
- grails-app/.../messages_cs_CZ.properties 3 kB
- grails-app/i18n/messages_da.properties 3 kB
- grails-app/i18n/messages_de.properties 4 kB
- grails-app/i18n/messages_es.properties 3 kB
- grails-app/i18n/messages_fr.properties 2 kB
- grails-app/i18n/messages_it.properties 2 kB
- grails-app/i18n/messages_ja.properties 4 kB
- grails-app/i18n/messages_nl.properties 3 kB
- grails-app/.../messages_pt_BR.properties 3 kB
- grails-app/.../messages_pt_PT.properties 3 kB
- grails-app/i18n/messages_ru.properties 4 kB
- grails-app/i18n/messages_sv.properties 3 kB
- grails-app/i18n/messages_th.properties 6 kB
- grails-app/.../messages_zh_CN.properties 2 kB
- grails-app/views/error.gsp 0.3 kB
- grails-app/views/index.gsp 3 kB
- grails-app/views/layouts/main.gsp 2 kB
- test/unit/.../TestControllerTests.groovy 0.3 kB
- application.properties 0.1 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
There are no comments yet on this issue.