Saturday, July 19, 2008

Shadow Services of Tapestry5 and example

The PropertyShadowBuilder service is used to allow a property of another service to be exposed as its own service. has many shadow service example, like:

* Builds a shadow of the RequestGlobals.request property. Note again that the shadow can be an ordinary singleton,
* even though RequestGlobals is perthread.
public Request buildRequest()
return, "request", Request.class);

Then, we can inject Request service into page, and we will find class of request is $Request_11b3a7d984b built at runtime.

private RequestGlobals requestGlobals;

private Request request;

void pageLoaded(){
// class $Request_11b3a7d984b
// class

No comments :