Hi Kinjan Shah welcome to Javaranch,
if you are getting the NullPointerException, then the above post should guide you.
But to me it seems that you are looking for the
servlet context's attribute.
So check if you are accessing the context parameter in the right way.
Hope this helps