You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2008/05/05 22:24:06 UTC
Tap 5.0.11 How to store Session id in ASO
I need to retrieve the http session id. One way to get
session id is to inject
RequestGlobals into my page and then get the
HttpRequest from RequestGlobals.
For simplicity sake, I try to inject the httpRquest
into an exisitng (session) ASO X
(which is already injected to my page) and
retrieve the session id from X.
With the above approach, I found that the ASO X for
different users always return identical
session id (the id of the first session created.)
Is there a way to store HttpRequest (or session id),
in ASO X, so that the
HtppRequest (or session id) is 'in sync' with the
session.
In AppModule :
public void contributeApplicationStateManager(
MappedConfiguration<Class,
ApplicationStateContribution> configuration,
final @Inject @Value("${tempDir}") String
tempDir,
final @Inject RequestGlobals requestGlobals)
{
HttpServletRequest request =
requestGlobals.getHTTPServletRequest();
ApplicationStateCreator<IUserDirManager> creator
=
new UserDirManagerCreator(request, tempDir);
configuration.add(IUserDirManager.class, new
ApplicationStateContribution("session", creator));
}
Thanks in advance for any assistance !
Shing
Home page : http://www.lombok.demon.co.uk/
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tap 5.0.11 How to store Session id in ASO
Posted by Howard Lewis Ship <hl...@gmail.com>.
Seems like an odd request.
Assuming you are storing the ASO in the session (the only option with
the default implementatons), then you (or the servlet API) must
already know the session id (i.e., from the request object, from
cookie in the request). So storing it in the ASO isn't useful.
You could just have a String field in your ASO and when you first
create your ASO, get the session id from the HttpServletRequest and
store it into the ASO.
On Mon, May 5, 2008 at 1:24 PM, Shing Hing Man <ma...@yahoo.com> wrote:
> I need to retrieve the http session id. One way to get
> session id is to inject
> RequestGlobals into my page and then get the
> HttpRequest from RequestGlobals.
>
> For simplicity sake, I try to inject the httpRquest
> into an exisitng (session) ASO X
> (which is already injected to my page) and
> retrieve the session id from X.
> With the above approach, I found that the ASO X for
> different users always return identical
> session id (the id of the first session created.)
> Is there a way to store HttpRequest (or session id),
> in ASO X, so that the
> HtppRequest (or session id) is 'in sync' with the
> session.
>
>
> In AppModule :
> public void contributeApplicationStateManager(
> MappedConfiguration<Class,
> ApplicationStateContribution> configuration,
> final @Inject @Value("${tempDir}") String
> tempDir,
> final @Inject RequestGlobals requestGlobals)
> {
>
> HttpServletRequest request =
> requestGlobals.getHTTPServletRequest();
>
> ApplicationStateCreator<IUserDirManager> creator
> =
> new UserDirManagerCreator(request, tempDir);
>
>
> configuration.add(IUserDirManager.class, new
> ApplicationStateContribution("session", creator));
> }
>
>
> Thanks in advance for any assistance !
>
> Shing
>
> Home page : http://www.lombok.demon.co.uk/
>
>
>
>
> __________________________________________________________
> Sent from Yahoo! Mail.
> A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator Apache Tapestry and Apache HiveMind
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tap 5.0.11 How to store Session id in ASO
Posted by Shing Hing Man <ma...@yahoo.com>.
I have found a solution.
I need to inject the shadow service HttpServletRequest
into my ASO.
Shing
--- Shing Hing Man <ma...@yahoo.com> wrote:
> I need to retrieve the http session id. One way to
> get
> session id is to inject
> RequestGlobals into my page and then get the
> HttpRequest from RequestGlobals.
>
> For simplicity sake, I try to inject the httpRquest
> into an exisitng (session) ASO X
> (which is already injected to my page) and
> retrieve the session id from X.
> With the above approach, I found that the ASO X for
> different users always return identical
> session id (the id of the first session created.)
> Is there a way to store HttpRequest (or session id),
> in ASO X, so that the
> HtppRequest (or session id) is 'in sync' with the
> session.
>
>
> In AppModule :
> public void contributeApplicationStateManager(
> MappedConfiguration<Class,
> ApplicationStateContribution> configuration,
> final @Inject @Value("${tempDir}") String
> tempDir,
> final @Inject RequestGlobals requestGlobals)
> {
>
> HttpServletRequest request =
> requestGlobals.getHTTPServletRequest();
>
> ApplicationStateCreator<IUserDirManager>
> creator
> =
> new UserDirManagerCreator(request, tempDir);
>
>
> configuration.add(IUserDirManager.class, new
> ApplicationStateContribution("session", creator));
> }
>
>
> Thanks in advance for any assistance !
>
> Shing
>
> Home page : http://www.lombok.demon.co.uk/
>
>
>
>
>
__________________________________________________________
> Sent from Yahoo! Mail.
> A Smarter Email
> http://uk.docs.yahoo.com/nowyoucan.html
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
>
>
Home page : http://www.lombok.demon.co.uk/
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org