• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servletContext Vs servletConfig

 
Tom Lee
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
What is the difference between servletContext & servletConfig..??.their usage...

Thanx in advance

Tom
 
Rajesh Agarwal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Both are in the same package javax.servlet.*

ServletConfig is used to get the initialization parameters whereas
ServletContext is used to get information about all other objects in the same name space, i.e the information about its environment.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"an indian",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65342
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Servlets forum.
 
Yuriy Zilbergleyt
Ranch Hand
Posts: 429
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletConfig lets you access the initialization parameters for the servlet itself.

ServletContext lets you access the initialization parameters for the entire web application, and share objects across the web application as well.

-Yuriy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic