wood burning stoves*
The moose likes Servlets and the fly likes Difference between attributes and parameters. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Difference between attributes and parameters." Watch "Difference between attributes and parameters." New topic
Author

Difference between attributes and parameters.

Rachit Kumar Saxena
Ranch Hand

Joined: Dec 24, 2011
Posts: 50
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: 50
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: 60053
    
  65

Speculation is useless -- init parameters are intended to apply constant values for the servlet instance.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between attributes and parameters.
 
Similar Threads
Difference between Arguments and parameters
problem with prepared statement
Difference between attributes and parameters
why i can not see any of servlet request parameters ?
Difference between a Parameter and an Attribute