I am trying to package a few custom GWT widgets I have developed into a separate GWT module so that they could be reused in other projects. My problem is figuring out where in the created JAR file should public resources like images and stylesheets be placed and what path do I then use to access them?
I have a JAR structure that looks like this
com
— companyname
—— gwt !Widgets.gwt.xml file
——— client !Java classes
META-INF
public
— image
— stylesheet
Widgets.gwt.xml needs to access a stylesheet in the public folder so I include the line and the Java classes need to access the images so I am using ‘images/Calender.png’ for that but when I run the application I get [WARN] 404 – GET messages and the resources aren’t loaded.
Use GWT’s ClientBundle functionality to access resources in your module. This will let you keep them in your
srcdirectories and prevent you from having to make any assumptions about how consumers of the module deploy their applications.