I believe this is only for Servlet 2.3, correct?

- Robert

John Espey wrote:

1) create an object that implements ServletContextListener (read the
javadocs on it to see how to configure it in web.xml)
2) put the object on the servlet context. Here's code from a listener that
I have:

public void contextInitialized(ServletContextEvent sce)
{

sce.getServletContext().setAttribute(PresentationConstants.RESULT_COUNT_CONT
ENTS_PROJECTS, resultCountOptions);
}
Most of the Struts and JSTL tags will then be able to find this object by
the name (a constant in my case) that you key the attribute to.

Hope this helps.




-----Original Message-----
From: Larry Hytail [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 20, 2003 12:24 PM
To: [EMAIL PROTECTED]
Subject: Universally Accessable Object



I have a table of information contained in a backend database.
The table is not very big and never will be. I would like to
create an object that holds the values from this table. I would
like this object to instantiate when the struts webapp is
started. Then I would like to be able to access this object from
any Action object within my struts application. Questions:

1) Where is the best place to put the instantiation of this object?

2) How do I get a handle on the object from the Action object?

Larry Hytail



---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to