Frage

java.lang.IllegalStateException: Cannot create a session after the response has been committed

Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <g:isSelfProfile>: Cannot create a session after the response has been committed

After upgrading to Grails 2.3.0 GA, when I try to access the session variable (or just call ${session == null}) in the view, I get an exception if the session was not created before (in the controller).

War es hilfreich?

Lösung

As a work around session can be accessed by the request variable without creating a new session. If the session is not created before this will return null.

${request.getSession(false)}

Also debug mode of the resources plugin i.e. * grails.resources.debug = true * triggers this...

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top