There are 2 ways you can include/reference a stylesheet with GWT.

1. If you use the stylesheet element in your module file, then the
stylesheet needs to be on the classpath for the compiler, not in src/
main/webapp.  Putting the stylesheet there (in the module) is called
"resource injection" or now apparently "resource inclusion" -
http://code.google.com/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideAutomaticResourceInclusion.

2. The other method, simply linking to the style sheet as you normally
would with any HTML in the host page <link href>, works too but then
you do not add anything to the module file.

If you DON"T plan to share your project as a module that others will
inherit, just link to the stylesheet from App.html, and that should
work fine. Running in hosted mode should not bypass your hosted page,
it just might not be in the right place (public folder).  Take a look
at the simplesample for an example of doing it with GWT-Maven:
http://gwt-maven.googlecode.com/svn/trunk/maven-googlewebtoolkit2-plugin/simplesample/.
There is an "index.html" file in src/main/webapp, but since that is
the root, and not the complete path of the module, that file just
redirects to where the host page actually is (src/main/resources/com/
path/public). That sample does use resource inclusion for CSS, but
that doesn't matter, it works either way.

On Apr 14, 11:56 pm, Joe Hudson <[email protected]> wrote:
> Hi,
>
> I am running the gwt target to start the application in hosted mode.
> This bypasses the normal App.html file in my web root.
>
> Is there any way I can have a stylesheet be included when running in
> hosted mode?  I have a stylesheet with the same name as my gwt.xml
> file.  I have also tried including <stylesheet src="App.css"/> in the
> gwt.xml file.
>
> Here is my setup (GWT 1.6):
> in src/main/java
> com.test.App.gwt.xml
>
> src/main/webapp
> App.css
> App.html
>
> Any help would be greatly appreciated.  Thanks.
>
> Joe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"gwt-maven" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/gwt-maven?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to