• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between attributes and parameters.

 
Rachit Kumar Saxena
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While theres a getInitParameter method,theres no setInitParameter method in ServletContext CLASS.But you can also set and get an attribute.Why?What is the difference between parameters and attributes?
 
Ashish Hiriadka
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext Init parameter are for passing any values which doesn't change very often. So there is no setInitParameter() method in servlet context.
 
Rachit Kumar Saxena
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply!!! But I would like to know IF setInitParameter had been used,it would have given the user the option of changing init parameters in java apart from the xml file.Your views?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Speculation is useless -- init parameters are intended to apply constant values for the servlet instance.
 
Pawan Singh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
init parameters are loaded along with servlet, that is at it's one time instanciation time, while attribute are the object which are passed , set, and get at run time when we need them......
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic