gwtgwt-designer

css is not affecting in browser but working fine in GWT designer


i wrote css for a button its working fine in GWT designer and it showing the image. but when i compile and run its not showing the image . and i tried getElement().getStyle() but no use i tried DOM.setStyleAttribute(btnNewButton.getElement(), "background", "url(../WEB-INF/btn.jpg)"); no use

please help me with this..

here's my css

.cancel {
    background-repeat: no-repeat;

    background-image: url( ../WEB-INF/btnCancel.jpg);

}

code..

Button btnNewButton = new Button("New button");

btnNewButton.setStyleName("cancelbutton");

btnNewButton.setText("cancel");

i am using GWT 2.4


Solution

  • Don't put files in the WEB-INF folder if you want to access them in a web page. The folder is not accessible.