You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by phillip rhodes <rh...@yahoo.com> on 2006/01/11 20:56:54 UTC
inject global into tapestry pages?
Trying to get my feet wet with T4...
I would like to see the syntax/example by which a tapestry page can access the application Global object.
Thanks.
Phillip Rhodeshttp://www.jsso.org Open source Java Identity and Authorization Serviceshttp://www.rhoderunner.com Open Source Java Ecommerce Suite
Re: inject global into tapestry pages?
Posted by Jason Dyer <jd...@bluetarp.com>.
If you're using annotations, you can add something like this to your page
class (i.e. Home.java)
@InjectState("global")
public abstract Global getGlobals();
and something like this to hivemodule.xml
<contribution configuration-id="tapestry.state.ApplicationObjects">
<state-object name="global" scope="application">
<create-instance class="your.package.Global"/>
</state-object>
</contribution>
Of course you'd have to define the class 'your.package.Global'.
-Jason
On Wednesday 11 January 2006 14:56, phillip rhodes wrote:
> Trying to get my feet wet with T4...
>
> I would like to see the syntax/example by which a tapestry page can access
> the application Global object.
>
> Thanks.
>
>
>
> Phillip Rhodeshttp://www.jsso.org Open source Java Identity and
> Authorization Serviceshttp://www.rhoderunner.com Open Source Java Ecommerce
> Suite
--
Mal: "Okay, help me find our man; he's supposed to be older. Kind of stocky,
wears a red sash crossways."
Kaylee: "Why does he do that?"
Mal: "Maybe he won the Miss Persephone pageant. Just help me look."
--------------
Jason Dyer
BlueTarp Financial, inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org