| Author |
Difference between attributes and parameters.
|
Rachit Kumar Saxena
Ranch Hand
Joined: Dec 24, 2011
Posts: 48
|
|
|
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
Joined: Feb 27, 2011
Posts: 5
|
|
|
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
Joined: Dec 24, 2011
Posts: 48
|
|
|
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
Joined: Jan 10, 2002
Posts: 56162
|
|
|
Speculation is useless -- init parameters are intended to apply constant values for the servlet instance.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Pawan Singh
Greenhorn
Joined: Jun 05, 2012
Posts: 9
|
|
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......
|
 |
 |
|
|
subject: Difference between attributes and parameters.
|
|
|