...
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 . (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.{footnote}) Wiki Markup
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"));
}
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
@SupportsInformalParameters
public class DBImage
{
@Parameter(required=true)
private Image image;
@Inject
private ComponentResources resources;
boolean beginRender(MarkupWriter writer)
{
writer.element("img", "src", image.toClientURL(), "class", "db-image");
resources.renderInformalParameters(writer);
writer.end();
return false;
}
}
|
...
Although these two classes have the same fully qualified class name, they are distinct classes because they are loaded by different class loaders.
Gliffy Diagram | ||||
---|---|---|---|---|
|
In a Tapestry application, most application classes are loaded from the middle class loader. Additional class loaders are used
to support live service reloading, and live component reloading (along with component class transformation).
...
Code Block | ||||
---|---|---|---|---|
| ||||
@OnEvent(value=EventConstants.SUCCESS, component="loginForm")
Object storeUserCredentialsAndReturnToProductsPage()
{
. . .
}
|
...
Wiki Markup |
---|
{scrollbar} |
____
Wiki Markup |
---|
{display-footnotes} |