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.
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
SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD
subject: using getInitParameter in a simle java class