Announcement Announcement Module
Collapse
No announcement yet.
class xxxController extends xxxController doesn't work Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • class xxxController extends xxxController doesn't work

    hi,

    i tried to modify my BookmarkController to subclass the SecureController:

    Code:
    package bookmarks
    import org.springframework.dao.DataIntegrityViolationException
    class BookmarkController extends SecureController{
    
        static allowedMethods = [save: "POST", update: "POST", delete: "POST"]
    
        def index() {
    
            redirect(action: 'list', params: params)
    
        }
    def list() {} def create(){} list(){} ....
    }
    when i run the server, the and click on the bookmarkcontroller, the server says:
    Message
    Cannot issue a redirect(..) here. A previous call to redirect(..) has already redirected the response.

    Around line 10 of grails-app\controllers\bookmarks\BookmarkController.groov y (line 10 is the line which i made bold)

    So whats wrong now? the weird thing is, when i run it without extends SecureController it works.

    for the sake of completeness the SecureController. (maybe something wrong here?!


    Code:
    package bookmarks
    
    abstract class SecureController {
    
        def beforeInterceptor = [
                    action: this.&auth,
                    except:['handleLogin','login', 'handleRegister', 'register']
                    ]
           
            private auth() {
                    if(!session.user){
                            redirect(controller:'user', action:'login')
                            }
                    }
    }
    regards,
    manuel

  • #2
    Maybe you downloaded the wrong file?

    Comment

    Working...
    X