[英]java load resource file like ClientBundle GWT
I'm writing a Java library, and I found that GWT has ClientBundle interface/class that can use like this: 我正在编写Java库,发现GWT具有ClientBundle接口/类,可以像这样使用:
public interface DefaultResources extends ClientBundle
{
@Source("source/resource.rs")
TextResource getTextResource();
}
How can I achieve that without using GWT? 不使用GWT怎么实现?
Many thanks! 非常感谢!
You can use Spring DI to achieve this. 您可以使用Spring DI来实现。
@Value("classpath:source/resource.rs")
Resource myResource;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.