Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Img works in dev mode but not production

    Hi,

    I have an Img object that works fine in dev mode (tested in FF), but not in production. It doesn't pick up the image, and is just blank.

    The code is:
    Code:
            Tab tTab4 = new Tab("Alerts");
            Img tImg4 = new Img("/images/alerts.png", 647, 763);
            tTab4.setPane(tImg4);
    I've checked and re-checked the war file. Appending "/images/alerts.png" to the app name, in place of the HTML file, in the browser brings up the image.

    It is the SGWT build from Feb. 17th. Any help would be appreciated.

    Thanks

    #2
    I figured it out - it's the old context root issue (required in prod, not required in dev). Just have to figure out which it is dynamically with a piece of code like the following:

    Code:
    String queryString = Window.Location.getParameter("gwt.codesvr");
            if (queryString != null && !queryString.equals("")) {
                // Dev Mode
                return "";
            } else {
                String path = Window.Location.getPath();
                int slashPos = path.substring(1).indexOf("/");
                return path.substring(0, slashPos + 1);
            }

    Comment

    Working...
    X