【问题标题】:Provide external file path in @Source("../../war/example.txt") textresource client bundle gwt在 @Source("../../war/example.txt") textresource client bundle gwt 中提供外部文件路径
【发布时间】:2017-08-30 19:09:12
【问题描述】:

在我的 GWT 应用程序中使用字符串资源概念,我不想向 @Source("some-external-path-not-class-path") 提供一些外部路径或 war 文件夹路径,例如 - @Source( "example.com/sometextfile.txt") 或 @Source("../war/sometextfile.txt")。

使用以下代码 -

public interface Resource extends ClientBundle
{
    public static Resource INSTANCE = GWT.create(Resource.class); 

    @Source("../../war/sometextfile.txt")
    TextResource textResource();
}

我不想这样做,以便我可以直接在服务器上外部部署我的资源文件如果仅在文本中有一些更改,我不需要部署我的整个项目。

【问题讨论】:

    标签: java gwt resources clientbundle


    【解决方案1】:

    那么要么你正在寻找ExternalTextResource,要么你不应该使用ClientBundle(它主要用于在JS中嵌入/内联资源;如果图像资源很大或者你明确表示,图像资源除外禁用内联和外部文本资源)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多