1

From GWT tutorial (http://www.gwtproject.org/doc/latest/DevGuideUiCss.html), we know there are multiple approaches for associating CSS files with your module. Therein, one way is using the <stylesheet> element in the module XML file. When I used the way to do it, I got the warning message below. It seems the way doesn't work. Here's the contents of module1.gwt.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.7.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.7.0/distro-source/core/src/gwt-module.dtd">
<module rename-to="entry1">
    <inherits name="com.google.gwt.user.User" />
    <inherits name='com.google.gwt.user.theme.clean.Clean'/>

    <source path="client" />
    <entry-point class="com.jst.gwt2.client.Entry1"></entry-point>
    <stylesheet src="../entry1.css" />
    <source path='client' />
    <source path='rpc' />
</module>

Here's the warning message:

GET /entry1.css
   [WARN] ignored get request: /entry1.css
   [WARN] not handled: /entry1.css

1 Answer 1

1

quoting @Thomas Broyer:
to get the full explanation click here

You'll have to change either

  • the path to your CSS (e.g. /entry1.css, but that won't necessarily work once deployed in production)
  • the location of your CSS (e.g. put it in your module's public path and reference it as <stylesheet src="entry1.css"/>)
  • the way you load it (e.g. inject it from your onModuleLoad, either as a StyleElement added to the Document; or possibly as a TextResource that you inject using StyleInjector –and use one less request to the server)
Sign up to request clarification or add additional context in comments.

1 Comment

Hi, Thomas Broyer: I tried the second way. It can work. Thanks very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.