Questions About Grails Filters

Basically, I have 2 questions regarding Grails filters.

  • According to grails documentation you can do something like below in the filter
if (userId != paramsUserId) {
    flash.message = "You can only modify yourself"
    redirect(action: 'list')
    return false
}

If the above condition is true, then how will the return statement be executed?

  1. Can I redirect some action to my filter that also has a redirect?
+5
source share
1 answer

1 - Returning false from the filter prevents the execution of additional filters (and the action if it is performed before the filter). The browser will receive a 302 redirect and go to the list method that you asked to redirect.

http://grails.org/doc/2.3.7/guide/single.html#filterTypes

2 - yep. - , . . firebug, , . HTTP 302 ( "" ), URL-, (, , .. URL- "", ). , url , .

- , - , .

+6

All Articles