This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on ServletContext

 
Veena Pointi
Ranch Hand
Posts: 442
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Chandra Sagi
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • 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: 442
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
Satish Ramasamy
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Veena,
Yes you are right.
 
Chandra Sagi
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess when it happens when the init() method is invoked. Not before.

Thanks
Chandu
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic