Grails Webflow : Error could not initialize proxy - no Session when trying to access a domain set in PageScope

陌路散爱 提交于 2019-12-02 02:22:35

I've seen this error before, and not related to the webflow, but using a tag inside a layout. In this case the layout is handled after the session is closed and you need to create a new session manually.

def currentUser = { attrs ->
  User.withTransaction {
    User user = User.get(x)
  }
}

The JIRA have the status won't fix because is not a good practice to make GORM queries inside TagLib's.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!