Martin Gladdish

Software 'n' stuff

Global Object in Tapestry 4.1

It’s no longer necessary to configure the Global object in the app’s .application file. Instead, the Global object is now managed by Hivemind. So, insert the following to your hivemodule.xml:

1
2
3
4
5
<contribution configuration-id="tapestry.state.ApplicationObjects">
  <state-object name="globalObject" scope="application">
    <create-instance class="com.company.project.tapestry.MyGlobalObjectClass"/>
  </state-object>
</contribution>

And then this object can be injected into your page classes with the following:

1
2
@InjectState("globalObject")
public abstract MyGlobalObjectClass getGlobal();

Comments