Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830
this week in the
Programmer Certification
forum!
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
paul wheaton
Sheriffs:
Ron McLeod
Devaka Cooray
Henry Wong
Saloon Keepers:
Tim Holloway
Stephan van Hulst
Carey Brown
Tim Moores
Mikalai Zaikin
Bartenders:
Frits Walraven
Forum:
Servlets
init options
Mike Phillip
Ranch Hand
Posts: 37
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
In my app there are more then 3
servlets
. And I need to call something like the init() method to config somethings.
But I think the init is only for its servlet, how can I do some init like so that all servlets can use the things I will start in it?
thanks
Bear Bibeault
Sheriff
Posts: 67752
173
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Research the concept of a
context listener
.
[
Asking smart questions
] [
About Bear
] [
Books by Bear
]
Devika Narasimhaiah
Greenhorn
Posts: 2
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
HI...
First write a Listener class which implements ServletContextListener. and
use setAttribute(var,val) and this attribute you can use in all servlets.
otherwise, use context-param tags in web.xml
That also works same.
Regards
Devika.N
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
How to obtain hostname during servlet init
JSF + Hibernate - startup
init and constructor in servlet
init() and init(conf)
question on implicit objects in EL?
More...