You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Reza Aliakbari <Re...@pdpsoft.com> on 2002/11/16 15:56:04 UTC

Reading application object in action.

Hi,
 
How can I read application object in action section?
As we now application is defined in jsp pages and is:
 
ServletConfig config = getServletConfig(); 
ServletContext application = config.getServletContext();
 
Cheers

RE: Reading application object in action.

Posted by Andrew Hill <an...@gridnode.com>.
Hi Reza,

To get the ServletContext in an Action you can use:
getServlet().getServletContext();

<btw>
The servlet that getServlet() returns is the struts ActionServlet ('within'
which all the actions execute).
</btw>

regards
Andrew

-----Original Message-----
From: Reza Aliakbari [mailto:Reza.Aliakbari@pdpsoft.com]
Sent: Saturday, November 16, 2002 22:56
To: 'struts-user@jakarta.apache.org'
Subject: Reading application object in action.


Hi,

How can I read application object in action section?
As we now application is defined in jsp pages and is:

ServletConfig config = getServletConfig();
ServletContext application = config.getServletContext();

Cheers


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>