English 中文(简体)
在离散的路边使用1美元-3}?
原标题:using ${resource} in a separated thread?

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.

因此,是否仍有资金?

感谢

最佳回答

这里有一些信息将显示你如何完成你努力做的工作。 还指出,它指出,你正在做的是设计不好。

问题回答

你的背景镜子无法在缺席时查阅用来保存你的照片的解放会议。 您可以使用一个像Executor,以拯救背景线下的野心。





相关问题
how to use DynamicResource in the code behind?

I d like to be able to set a property to a dynamic resource programmatically. myControl.Property = this.Resource[key] is not a valid response, since if the resource with the key key is replaced, ...

PHP - Foreach loops and ressources

I m using a foreach loop to process a large set of items, unfortunately it s using alot of memory. (probably because It s doing a copy of the array). Apparently there is a way to save some memory with ...

C# Play MP3 from Resources with MCI or WMP control?

I have a MP3 file in my Resources of Visual C#. I m trying to find out if there is a way I can play this MP3 in a Windows Media Player control or with MCI, I m not particular. I m fairly new to C#. ...

Convert files of any types to a file with c strings

Please suggest a small command-line utility (for Windows) to convert files from particular directory to a valid c file. Maybe it can be done just with batch commands? The resulting file should look ...

How to sort ResourceSet in C#

I have a resource file named filetypes.resx. Some how I figured out to bind the resource values to dropdownlist, but I don t know how to sort the values of ResourceSet. Here is what I did so far, ...

热门标签