• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using getInitParameter in a simle java class

 
nitish dhar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please tell me how to use
getInitParameter
in a simple java class ,i mean which does not extend a servlet

i tried it by implementing the ServletContext interface and then used the



 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the class runs in a servlet container, it should have access to the container (typically through the servlet, but there are other ways) in order to access the ServletContext and then the initial parameters.

If you're not running in a container, why would you need the initial parameter.
 
Soniya Ahuja
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you specify why you need initialization parameters? If you just need to pass some values, there are other ways. Initialization parameters, as the name suggests are for values that are needed typically during Context initialization or a servlet (config) initialization.

Please specify your purpose of using the params so that we can suggest a workaround
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic