This is how you inject the ApplicationStateManager, it gets autowired by
hivemind.
private ApplicationStateManager appStateManager;
public void setAppStateManager(ApplicationStateManager manager) {
appStateManager = manager;
}
ApplicationObject getSessionData() {
return appStateManager.get("sessionDataId"); //the id is the id of
the ASO declared in your hivemodule.xml
}
James Carman wrote:
Yes, there's an tapestry.state.ApplicationStateManager service in the
registry from which you can do:
SessionData sessionData = ( SessionData )applicationStateManager.get(
"session-data" );
Of course, you'd use whatever name you used to register the state object.
-----Original Message-----
From: Jean-Eric Cuendet [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 28, 2006 5:24 AM
To: Tapestry users
Subject: Re: Getting session state from within a Tapestry service
Thanks, but what I need is the State object from hivemind.
Is it possible to get my SessionData object from hivemind through the
getSession().getID() from WebRequest?
Or is there another way?
I tried @InjectState("sessionData") but that is not possible in a Service.
-jec
Daniel Lydiard wrote:
@InjectObject("infrastructure:request")
public abstract WebRequest getRequest();
getRequest().getSession()
http://jakarta.apache.org/tapestry/tapestry/apidocs/org/apache/tapestry/web/
WebRequest.html
----- Original Message ----- From: "Jean-Eric Cuendet" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, February 27, 2006 2:08 PM
Subject: Getting session state from within a Tapestry service
Hi,
I need to get the session state from a Typestry service (from the
servoce() method)
Is there a way to do it? I'm unable to find any...
Thanks a lot
-jec
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]