Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2 final
-
Fix Version/s: 1.2.1
-
Component/s: None
-
Labels:None
Description
The request filter is not triggered on the default action of the controller when you specify a starts with for the controller name/uri.
For example, if go to (default action for binderController is index):
.../testAb/binder
the filters do not get executed.
Attachments
-
$i18n.getText("admin.common.words.hide")
- testAB.zip
- 08/Jan/10 5:49 PM
- 863 kB
- Dhara Shah
-
- testAB/.classpath 6 kB
- testAB/.DS_Store 6 kB
- __MACOSX/testAB/._.DS_Store 0.1 kB
- testAB/.project 0.5 kB
- testAB/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- testAB/application.properties 0.2 kB
- testAB/build.xml 5 kB
- testAB/grails-app/conf/BootStrap.groovy 0.1 kB
- testAB/grails-app/conf/Config.groovy 3 kB
- testAB/grails-app/conf/DataSource.groovy 0.6 kB
- testAB/grails-app/.../RequestFilters.groovy 0.5 kB
- testAB/grails-app/.../resources.groovy 0.0 kB
- testAB/grails-app/.../UrlMappings.groovy 0.2 kB
- testAB/.../AfterRedirectController.groovy 0.3 kB
- testAB/.../BinderController.groovy 2 kB
- testAB/grails-app/domain/Book.groovy 0.2 kB
- testAB/grails-app/domain/Page.groovy 0.8 kB
- testAB/grails-app/.../messages.properties 3 kB
- testAB/grails-app/.../messages_de.properties 3 kB
- testAB/grails-app/.../messages_es.properties 3 kB
- testAB/grails-app/.../messages_fr.properties 2 kB
- testAB/grails-app/.../messages_it.properties 2 kB
- testAB/grails-app/.../messages_ja.properties 2 kB
- testAB/grails-app/.../messages_nl.properties 3 kB
- testAB/.../messages_pt_BR.properties 3 kB
- testAB/grails-app/.../messages_ru.properties 4 kB
- testAB/grails-app/.../messages_th.properties 5 kB
- testAB/.../messages_zh_CN.properties 2 kB
- testAB/grails-app/views/error.gsp 2 kB
- testAB/grails-app/views/index.gsp 0.9 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Hide
Jeff Brown
added a comment -
The User Guide has been updated to point out that the uri attribute is specified as an ant style path.
http://github.com/grails/grails/commit/83d6ca4dba2c4d2f6d52ac415e63c0af7e86347e
Show
Jeff Brown
added a comment - The User Guide has been updated to point out that the uri attribute is specified as an ant style path.
http://github.com/grails/grails/commit/83d6ca4dba2c4d2f6d52ac415e63c0af7e86347e
Show
Jeff Brown
added a comment - reopening to update the fix version
This may simply be a documentation issue. As the implementation is right now, the uri restriction uses an ant path style matcher while the controller restriction uses a regex. I think this makes sense, but isn't clear in the documentation.
The sample app has a filter that looks like this:
class RequestFilters { def filters = { uriCheck(uri: /bind.*/) { before = { // do something } } } }Depending on what you actually want to match, one of these may work:
class RequestFilters { def filters = { uriCheck(uri: '/bind*/**') { before = { // do something } } } }class RequestFilters { def filters = { uriCheck(uri: '/bind*/*') { before = { // do something } } } }It may be that we just need to add some information to the documentation to clarify that the uri value is an ant path expression, not a regex.
class RequestFilters { def filters = { uriCheck(uri: /bind.*/) { before = { // do something } } } }class RequestFilters { def filters = { uriCheck(uri: '/bind*/**') { before = { // do something } } } }class RequestFilters { def filters = { uriCheck(uri: '/bind*/*') { before = { // do something } } } }