...
Limiting fields to private means that Tapestry can do the necessary processing one class at a time, as needed, at runtime. More complex
Aspect Orient Programming systems such as AspectJ can perform similar transformations (and much more complex ones), but requires a dedicated build step (or the introduction of a JVM agent).
Why don't my informal parameters show up?
Getting informal parameters to work is in two steps. First, you must make a call to the ComponentResources.renderInformalParameters()
method, but just as importantly, you must tell Tapestry that you want the component to support
informal parameters, using the SupportsInformalParameters
annotation. Here's a hypothetical component that displays an image based on the value of a Image
object (presumably, a database entity):
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;
}
}
|