You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Puneet Vardhan <pu...@sengen.com> on 2001/04/18 17:05:04 UTC
How to access Action Mapping instance if session expires
Hi,
How can I access the action mapping instance if session is expired?
I have a global forward in struts-config.xml which points to logon page
<global-forwards>
<forward name="logon" path="/logon.jsp"/>
</global-forwards>
in session expires I need to forward to logon page
something like if ( session == null ) mapping.findForward(logon);
Is the ActionMapping object kept in session scope or application
scope?
Thanks
Puneet
Re: How to access Action Mapping instance if session expires
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Wed, 18 Apr 2001, Puneet Vardhan wrote:
> Hi,
> How can I access the action mapping instance if session is expired?
> I have a global forward in struts-config.xml which points to logon page
>
> <global-forwards>
> <forward name="logon" path="/logon.jsp"/>
> </global-forwards>
>
> in session expires I need to forward to logon page
>
> something like if ( session == null ) mapping.findForward(logon);
>
> Is the ActionMapping object kept in session scope or application
> scope?
> Thanks
> Puneet
>
The ActionMapping instances themselves are stored in application scope,
because they are constant for the entire application (and shared by all
users).
Within an Action.perform() method, the logic you've described above should
work fine.
Craig
Re: How to access Action Mapping instance if session expires
Posted by Rajan Gupta <rg...@yahoo.com>.
I am not sure if u can, since actionmapping is a protected variable in
ActionServlet. Storing it in session will result in bloating the session
unnecessary, if u store it in application context, I do not think you can
get access to the application context in HttpSessionBindingEvent. You
might want to consider a kludge such as using a singleton to access the
the actionmapping & extending ActionServlet.
If number of sessions & memory is not an issue for you, then you could
consider putting it in the session
Let me also know what solution you found for this.
--- Puneet Vardhan <pu...@sengen.com> wrote:
> Hi,
> How can I access the action mapping instance if session is expired?
> I have a global forward in struts-config.xml which points to logon page
>
> <global-forwards>
> <forward name="logon" path="/logon.jsp"/>
> </global-forwards>
>
> in session expires I need to forward to logon page
>
> something like if ( session == null ) mapping.findForward(logon);
>
> Is the ActionMapping object kept in session scope or application
> scope?
> Thanks
> Puneet
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/