I want to perform a simple task ! but dont know if it is possible or not!
我有一个可操作的农艺班,它一直在使用ool子。 我想在我能干的班子里做的是:
public void run() {
EventPhoto.withTransaction { status ->
EventPhoto photo = new EventPhoto(event:eventInstance)
photo.imageUrl = "${resource(dir: images/uploads ,file:image.name, absolute:true)}"
photo.thumbnailUrl = "${resource(dir: images/uploads ,file:thumb.name, absolute:true)}"
}
}
事实是,由于我的座右铭不是在quest子里,我正经历以下错误:
java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
因此,是否仍有资金?
感谢