What's the difference between the @Component and @InjectComponent annotations?
The @Component annotation is used to define the type of component, and its parameter bindings. When using @Component, the template must not define the type, and any parameter bindings are merged in:
Back to home
...
@Component(parameters={ "page=index" })
private PageLink home;
Here the type of component is defined by the field type. The field name is matched against the t:id in the template. The page parameter is set in the Java class, and the informal class parameter is set in the template. If the tag in the template was
By contrast, @InjectComponent expects the component to be already defined, and doesn't allow any configuration of it: