hi,
i tried to modify my BookmarkController to subclass the SecureController:
when i run the server, the and click on the bookmarkcontroller, the server says: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(){} .... }
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?!
regards,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') } } }
manuel


Reply With Quote