Wednesday, April 27, 2011

Public Paths inside Modules

Hi,

I'm trying to work with a modularized approach with GWT.

I get two Eclipse projects (Commons and Projetc1). Commons has
resources like CSSs, images and user interfaces. Project1 inherits a
module from Commons (jar reference) and tries to reuse some resources.

When I try to access the first screen I get this error:

00:00:13.050 [ERROR] Resource ../style/images/rooLogo.png not found.
Is the name specified as Class.getResource() would expect?

The screen and the resources are inside Commons:

<ui:image field='gwtLogo' src="../style/images/gwtLogo.png"/>
<ui:image field='rooLogo' src="../style/images/rooLogo.png"/>

GWT documentation says to use "relative path":

"Public Path
When referencing public resources in client code (for example, setting
the URL of an Image widget, you should construct the URL like this:
GWT.getModuleBaseURL() + "resourceName.png". When referencing public
resources from a Module XML File, just use the relative path within
the public folder, the module's base URL will be prepended
automatically. When amodule inherits other modules, their public paths
are combined so that each module will have access to the static
resources it expects.
The default public path is the public subdirectory underneath where
the Module XML File is stored."

What is wrong?

Thanks

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment