You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mojoRising <jp...@averoinc.com> on 2008/05/06 21:32:22 UTC

Does Execute and Wait Interceptor work with ServletRequestAware interface?

I am using the Execute and Wait Interceptor on my login action. This action
needs to access the HTTPRequest object so that it can get the HTTPSessionId,
and the request headers and store all of this in the database as well as
putting the userObject in the session itself.

Documentation says that when using ExecAndWait I need to implement
SessionAware interface and access my session via the sessionMap. However,
the only way I can get the request headers and the sessionID is by
implementing ServletRequestAware, getting the request object first, and then
getting the real HTTPSession from there (not the SessionMap).

I am in a quandry. Do I need to implement both interfaces? Is
ServletRequestAware as reliable when using execAndWait as SessionAware is?





-- 
View this message in context: http://www.nabble.com/Does-Execute-and-Wait-Interceptor-work-with-ServletRequestAware-interface--tp17090576p17090576.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Does Execute and Wait Interceptor work with ServletRequestAware interface?

Posted by Laurie Harper <la...@holoweb.net>.
mojoRising wrote:
> I am using the Execute and Wait Interceptor on my login action. This action
> needs to access the HTTPRequest object so that it can get the HTTPSessionId,
> and the request headers and store all of this in the database as well as
> putting the userObject in the session itself.
> 
> Documentation says that when using ExecAndWait I need to implement
> SessionAware interface and access my session via the sessionMap. However,
> the only way I can get the request headers and the sessionID is by
> implementing ServletRequestAware, getting the request object first, and then
> getting the real HTTPSession from there (not the SessionMap).
> 
> I am in a quandry. Do I need to implement both interfaces? Is
> ServletRequestAware as reliable when using execAndWait as SessionAware is?

The documentation doesn't say you specifically need to implement 
SessionAware, it just uses that as an example of how to reference 
resources you might otherwise acquire through ActionContext. 
Implementing ServletRequestAware should be fine.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org