Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 16-02-06, 04:07 AM   #1 (permalink)
Junior Member
 
Join Date: Feb 2006
Location:
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 praveen has disabled reputation


What is the difference between ServletConfig and ServletContext.?


PLease help me out.


praveen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16-02-06, 05:31 AM   #2 (permalink)
Moderator
 
Join Date: Jan 2006
Posts: 823
Thanks: 25
Thanked 23 Times in 17 Posts
Thanks: 25
Thanked 23 Times in 17 Posts
Blog Entries: 1
Rep Power: 12 Vision has disabled reputation
servlet context is used if u want some values which must exist for the life time
of the application. A servlet config object used by a servlet container to pass
information to a servlet during initialization.The ServletContext object is
contained within the ServletConfig object, which the Web server provides the
servlet when the servlet is initialized.


Vision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16-02-06, 11:52 AM   #3 (permalink)
Member
 
Join Date: Feb 2006
Location: India
Posts: 45
Thanks: 0
Thanked 2 Times in 2 Posts
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 3 solletilakshmi has disabled reputation


ServletConfig and ServletContext are interfaces as part of javax.servlet


ServletContext is associated with an application.ServletConfig is associated with a particular Servlet.The webcontainer maintains only one context object for one application and multiple number of config objects.config objects are like localparamenter and context object is like global parameter.


solletilakshmi is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16-02-06, 12:26 PM   #4 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello









ServletContext: Defines
a set of methods that a servlet uses to
communicate with its servlet container,
for example, to get the MIME type of a file,
dispatch requests, or write to a log file.The
ServletContext object is contained within
the ServletConfig object, which the Web
server provides the servlet when the servlet
is initialized



ServletConfig:
The object created after a servlet is instantiated
and its default constructor is read. It
is created to pass initialization information
to the servlet.




__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16-02-06, 12:30 PM   #5 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello



1)

Parameters defined in the ServletContext are visible for all servlets

Where as parameters defined in the ServletConfig are visible to the servlet where it has been defined .



2)

ServletContext has application scope wide

where as ServletConfig has Servlet scope

ServletContext has a life time as that of container.,


__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +6.5. The time now is 03:17 AM.





Search Engine Optimization by vBSEO 3.1.0