Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

struts - setting a variable in application scope

843841May 10 2005 — edited Apr 11 2007
I'm running an application using struts and I want to set a variable in the application scope when the applications first starts up. I'm imagining doing something like:
getServletContext().setAttribute(variable_name, variable_value);
Or, even easier, can I just set a value in an XML configuration file somewhere and have it appear in the application scope?

I want to put this value in the application scope only once -- not every time a request comes in to my web application. How do I do this?

Thanks,

Jon
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 9 2007
Added on May 10 2005
12 comments
638 views