• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on ServletContext

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We know the difference between init param and context param is scope.init param scope is for servlet and context param scope is for the web app. And also init param is initialized when container initiales servlet by calling init() method.After this if we change value of init param in DD,it is not reflected in servlet ,unless untill we redeploy/restart the server.How about Context parameter?If we change value of context parameter in DD,is it reflected in the servlet without even need of redeploying/restarting the server? Is ContextParameter value read only once when ServletContext is created,i.e when web app is deployed?

Thanks
Veena
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Veena Point:
How about Context parameter?If we change value of context parameter in DD,is it reflected in the servlet without even need of redeploying/restarting the server? Is ContextParameter value read only once when ServletContext is created,i.e when web app is deployed?

Thanks
Veena



Hi,
You need to restart the server for the changes in DD to to be reflected. Container creates a new instance of ServletContext when it is started. A discussion on this is in HFJS book pages 159,160. Hope this helps.....

Thanks
Chandu
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah,read just now.Thanks.Just to be sure,everything happens,like creating ServletContext,reading context params from DD,creating config,reading init params from DD.....happens before container calls init method right?
[ March 01, 2006: Message edited by: Veena Point ]
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Veena,
Yes you are right.
 
Chandra Sagi
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess when it happens when the init() method is invoked. Not before.

Thanks
Chandu
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic