I have some JavaScript files, a main HTML file, a main CSS file, and some CSS files that get imported into the main one.
I understand that I can put static files in
As I see it, it depends on your requirements, but let's start at a speaking example first ...
I find the documentation (should be GWT 2.6.0) about this to be incorrect or at least incomplete/confusing. As I see it (I am not a guru so please correct me if my investigations are wrong!) I am looking at the following example proj structure
myproj/
src/my/gwtproj/
client/
img/
foo1.png
AppClientBundle.java
foo2.png
public/
img/
foo3.png
foo4.png
war/
img/foo5.png
foo6.png
.classpath
.project
Imagine we may (or may not) need to reference such resources in some AppClientBundle interface (or other application reference context):
interfaces AppClientBundle extends ClientBundle {
@Source("img/foo1.png")
ImageResource fooImg();
}
Then it seems to depend on your Requirements, e.g.:
AppClientBundle interface via @Source annotationsfoo2.png vs. img/foo1.pnghttp://host1/gwtapp1/foo4.png vs. http://host1/gwtapp2/foo4.pnghttp://host1/gwtapp1/foo4.png vs. http://host1/foo6.pngHere's what one can do (Possibilities) and it's implications regarding R.* above:
my.gwtproj.client (here e.g. foo1.png)
@Source("img/foo1.png")... works finepublic folder (in my case my.gwtproj.public), but creating it as a package in Eclipse does not me allow this (since public is a reserved Java key word, but creating it via the Navigator view works)
@Source above does not work (likely because it's an issue with the relative AppClientBundle file system location)public foldermyproj/war, e.g. projdir/war/foo6.png
@Sourcehttp://host1/foo6.pngmyproj/war, e.g. projdir/war/img/foo5.png
@Source("img/foo5.png") would not work anymore