Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You are allowed to create sub-packages, to help organize your code better and more logically. For example, you might have _root-package.pages.account.ViewAccount, which would have the page name "account/viewaccount"

Footnote

Tapestry would also create an alias "account/view", by stripping off the redundant "account" suffix. Either name is equally valid in your code, and Tapestry will use the shorter name, "account/view" in URLs.

In addition, it is possible to define additional root packages for the application:

Code Block

public static void contributeComponentClassResolver(Configuration<LibraryMapping> configuration) {
       configuration.add(new LibraryMapping("", "com.example.app.tasks"));
       configuration.add(new LibraryMapping("", "com.example.app.chat"));
}

LibraryMappings are used to resolve a library prefix to one or more package names. The empty string represents the application itself; the above example
adds two additional root packages; you might see additional pages under com.example.app.tasks.pages, for example.

Warning

Tapestry doesn't check for name collisions, and the order the packages are searched for pages and components is not defined. In general, if you
can get by with a single root package for your application, that is better.

Why do my instance variables have to be private?

...