Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

ServletContext.setAttribute and init_params

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How are the parameters that get set in init_param section of web.xml different from "attributes" that can be set on or gotten from the ServletContext?
Thanks,
Aruna.
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, let me rephrase that-
Hi,
How are the parameters that get set in context_param section of web.xml different from "attributes" that can be set on or gotten from the ServletContext?
Thanks,
Aruna.
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the context param section, we can set Intialization parameters for servlet Context which can not be reset again programatically, whereas using ServletContext.setAttribute() and ServletContext.getparameter(), u can reset/get any number of parameters at RUNTIME.
=> These r the init parameters for ServletContext.
One another set of parameters r there for Servlet alone which is not shareable at Context level.
These init parameters reside under <Servlet> .. </servlet> tag and r only for this servlet.
Hope i m clear enough.
best regards, Dharmin
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey Dharmin and Aruna
i found u both of u wrong
aruna is wrong is question context-param
and dharmin there is no method calles getParameter it getInitParam(String).
and about question setAttribute gives u a flexibility for setting a attributes as well as api also gives u a flexibility for removing that attribute.It also bounds an Object where in case of context-param u can sepecify String para only not Objects.
I hope this is much clear
Rishi
 
Aruna Raghavan
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of you.
I thought I rephrased the question. I did understand what Dharmin was saying also.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic