It would be nice if a runtime flag were added to the hosted mode shell
that would let one specify the location to write generated image
bundle files. In my case, I use Eclipse WTP to host the server (using
-noserver), and getting to the generated image bundle files is a
hassle (they go under <eclipse project dir>/www/<module name>). I
really want them to be generated in <eclipse project dir>/WebContent
so that they can be served to the hosted mode browser successfully.
Note that I choose to dispense with the module name as part of the
path on the server.
Phil
On Feb 12, 6:42 pm, "Sumit Chandel" <
sumitchan...@google.com> wrote:
> Hi Oliver,
>
> The ImageBundle works by assembling each of the individual images referenced
> in the respective getPicX() and
> @gwt.resourcecom/xxxx/yyyy/public/images/picx.jpg into one image
> bundle. Once that bundle
> is generated, all you need to do is host that image file from the same path
> as your generated GWT JavaScript files.
>
> The @gwt.resource notation is only relevant to the GWT compiler to know
> where to pick up the individual images that will be bundled into the
> ImageBundle. The individual images actually don't need to be hosted on the
> server, only the generated image bundle. As long as you package that single
> image bundle with your generated JavaScript files, you should not run into
> any problems, in hosted mode or in deployed.
>
> If you have other images which are not part of the bundle that you would
> like to package differently in the EAR file, you can use the GWT.isScript()
> method call to determine whether you're running in hosted mode or in web
> mode, and then set the path for the Image accordingly.
>
> On the point of placing the single image bundle in the same package as the
> generated JS files, for most developers this hasn't been an issue, but I'm
> curious to know whether this poses a problem for your particular use case.
> Is there any reason why placing the image bundle file in the same path as
> the generated JS files would be a problem? If there is a reason why you
> would be interested in being able to place the image bundle file in a
> separate package, let us know.
>
> Hope that helps,
> -Sumit Chandel
>