This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
We're a friendly group, but we do require members to have valid display names.
Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.
Please edit your profile and correct your display name since accounts with display names get deleted, often without warning
Your display name was valid, now it is not. Please change it back or we will have to close your account.
thanks, Dave
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35241
7
posted
0
If you read through the javadocs for the two, you'll see that they serve very different purposes. Roughly speaking, ServletContext exists one a per application, while ServletConfig exists one per servlet.
generally it's a belief that there is one servletcontext per application. but in reality
this is the case when your application is running on one jvm. if your application is running on more than one jvm's than you have more than one servletcontext objects for your application (one servlet context object per jvm).
but your servlet config object is always one per servlet/jsp.
If you check through the ServleConfig API, you will find no setter methods. Only getter methods are available. obviously you can't set an initial parameter.
with ServletContext, you will find a setter method, setAttribute(String string, Object o) No setParameter() even with ServletContext.As said above parameters can't be set.
Please don't post questions to threads that deal with a completely different topic - start a new thread. It gets confusing if multiple subjects are part of the same thread.