Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed "visibility" to "access level" per Java standard terminology

...

Here's a minimal component that outputs a fixed message, using a template with a matching file name:

Section
Column
Code Block
java
java
titleHelloWorld.java
package org.example.myapp.components;
public class HelloWorld
{
}
Column
Code Block
xml
xml
titleHelloWorld.tml
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"><html>
    Bonjour from HelloWorld component.
</t:container>html>

In this the example above, the HelloWorld class contains no code at all (except what it inherits from the Object class and what Tapestry adds invisibly).

...

These methods are not necessarily public; they can have any visibility access level you like (unlike in Tapestry 4). By convention they usually have package-private access level (the default).

Component Packages

Component classes must exist within an appropriate package (this is necessary for runtime code transformation and class reloading to operate).

...

Since
5.3.2
5.3.2

Since release 5.3.2, instance variables may be protected, or package private (that is, no visibility access modifier). Under specific circumstances they may even be public (public fields must either be final, or have the @Retain annotation).

...