Provide external file path in @Source("../../war/example.txt") textresource client bundle gwt

201 views Asked by At

Using string resource concept in my GWT application, I wan't to provide some external path or path of war folder to @Source("some-external-path-not-class-path") Eg.- @Source("example.com/sometextfile.txt") OR @Source("../war/sometextfile.txt").

Using following code -

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

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

I wan't to do this so that I can externally deploy my resource file on server directly I need not deploy my whole project if there is some changes only in text.

1

There are 1 answers

0
Thomas Broyer On

Then either you're looking for ExternalTextResource, or you shouldn't use ClientBundle (it's primarily meant to embedded/inline resources within the JS; with the exceptions of image resources if they're big or you explicitly disable inlining, and external text resources)