Project Structure

GWT projects are overlaid onto Java packages such that most of the configuration can be inferred from the classpath and your module definitions.

If you are starting a GWT project from scratch, you should use the standard GWT package layout, which makes it easy to differentiate client-side code from server-side code. For example, suppose your new project is called "Calendar". The standard package layout would look like this:

Package Purpose
com/example/cal/The project root package contains module XML files
com/example/cal/client/Client-side source files and subpackages
com/example/cal/server/Server-side code and subpackages
com/example/cal/public/Static resources that can be served publicly

and examples files would be arranged like so:

FilePurpose
com/example/cal/Calendar.gwt.xmlA common base module for your project that inherits com.google.gwt.user.User module
com/example/cal/CalendarApp.gwt.xmlInherits the com.example.cal.Calendar module (above) and adds an entry point class
com/example/cal/CalendarTest.gwt.xmlA module defined by your project
com/example/cal/client/CalendarApp.javaClient-side Java source for the entry-point class
com/example/cal/client/spelling/SpellingService.javaAn RPC service interface defined in a subpackage
com/example/cal/server/spelling/SpellingServiceImpl.javaServer-side Java source that implements the logic of the spelling service
com/example/cal/public/Calendar.htmlAn HTML page that loads the calendar app
com/example/cal/public/Calendar.cssA stylesheet that styles the calendar app
com/example/cal/public/images/logo.gifA logo
Tip
The easiest way to create a GWT project from scratch is to use the projectCreator script.