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
升级到Grails 2.3.0 GA后,当我尝试在视图中访问session
变量(或只是调用${session == null}
)时,如果之前没有创建会话,则会出现异常(在控制器中。)
答案 0 :(得分:3)
由于可以通过请求变量访问会话,而无需创建新会话。如果在此之前未创建会话,则返回null。
${request.getSession(false)}
还有资源插件的调试模式,即* grails.resources.debug = true *触发此...