Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor formatting

...

Below is a sample project, whose root package is com.example.myapp:

Main source files - src/main/java

Main Java source files, the files that will be compiled into the WAR file, are in src/main/java. This is only Java source files. You can see the Index.java source file inside the pages subpackage, and the Layout.java source file inside the components subpackage. The package names demonstrated here are required, dictated by the rules for component classes.

Compiled Java classes will ultimately be packaged in the WAR inside the WEB-INF/classes folder.

Classpath Resources - src/main/resources

Resource files are under src/main/resources. This includes the message catalog for the Index page (Index.properties), as well as the message catalog and component template for the Layout component (Layout.tml). These files will also be packaged into the WEB-INF/classes folder of the WAR.

Component templates will always be stored in the resources folder. Templates for pages may be packaged in the WAR proper instead.

Context Resources - src/main/webapp

The WAR is built primarily from the src/main/webapp folder; this is where ordinary files are stored (such as images and stylesheets). Page templates may also be stored here (Index.tml). The file src/main/webapp/WEB-INF/web.xml is the servlet container deployment descriptor, which has a very specific configuration for Tapestry.

The build tool (usually Maven) will be responsible for putting compiled classes and resources into the WEB-INF/classes folder of the WAR, and for putting the Tapestry library, and its dependencies (as well as any additional libraries defined by your application) into the WEB-INF/lib folder.

Testing - src/test

The folders src/test/java and src/test/resources are used when compiling and executing tests. Files in these folders are not packaged into the final WAR.


Scrollbar