-Original Message-
From: Mark Kaye
Within an action, how can I get hold of an Object that has
been stored in the ServletContext inside which my struts app
is running?
OK, I figured it out, is the best way:
Properties properties = (Properties)
ServletContext sc = this.servlet.getServletContext();
Object obj = sc.getAttribute( nameOfObject);
Mark
-Original Message-
From: Mark Kaye [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 9:36 AM
To: Struts Users Mailing List
Subject: [Core] Easy question!
Within an action,
servlet member variable of Action is avaliable to gain access to
ServletContext.
ServletContext application = servlet.getServletContext();
DataManager manager =
(DataManager)application.getAttribute(Constants.DATA_MANAGER);
-Original Message-
From: Mark Kaye [mailto:[EMAIL PROTECTED]]
-Original Message-
From: Galbreath, Mark [mailto:[EMAIL PROTECTED]]
ServletContext sc = this.servlet.getServletContext();
Object obj = sc.getAttribute( nameOfObject);
I'm doing this in a startup servlet:
propFile = getServletContext().getRealPath(clubPropFileName);
Properties
4 matches
Mail list logo