You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Looser <lo...@gmx.de> on 2003/11/10 16:03:12 UTC
Accessing application scope in Action.execute()
Hi,
is there any chance to access objects in application scope in my action
classes ?
I have to override the .execute(ActionMapping mapping,ActionForm
form,HttpServletRequest request,HttpServletResponse response) method but
none of these parameters give me access to application scope like
'getServletContext().getAttribute("myAttribute")' would do.
Which is the best practise to store objects in application scope and
retrieve them back in my ActionClasses ?
Thx for your answers...
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Accessing application scope in Action.execute()
Posted by Frank Schaare <lo...@gmx.de>.
Hi David,
>getServlet() followed by two more commands:
>
>getServlet().getServletContext().getAttribute(String);
>OR
>getServlet().getServletContext().setAttribute(String, obj);
>
>Regards,
>
this was a great help for me thank you.
Hope my name is shown correctly now...
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: Accessing application scope in Action.execute()
Posted by David Friedman <hu...@ix.netcom.com>.
Dear Looser,
Inside the execute, you can set/get application
scope properties using the Action class methods
getServlet() followed by two more commands:
getServlet().getServletContext().getAttribute(String);
OR
getServlet().getServletContext().setAttribute(String, obj);
Regards,
David
-----Original Message-----
From: Looser [mailto:loosers-inc@gmx.de]
Sent: Monday, November 10, 2003 10:03 AM
To: struts Mailinglist
Subject: Accessing application scope in Action.execute()
Hi,
is there any chance to access objects in application scope in my action
classes ?
I have to override the .execute(ActionMapping mapping,ActionForm
form,HttpServletRequest request,HttpServletResponse response) method but
none of these parameters give me access to application scope like
'getServletContext().getAttribute("myAttribute")' would do.
Which is the best practise to store objects in application scope and
retrieve them back in my ActionClasses ?
Thx for your answers...
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org