servletContext.getResource("/") method is giving null ???
843835Aug 27 2002 — edited Sep 6 2002Hi,
ServletContext sc = config.getServletContext() ;
java.net.URL url = sc.getResource("/");
The above code is in init() method of my servlet. Here problem is that 'url' is coming 'null', i mean if try to give url.toString(),
i am getting NullPointerException.
I am testing this code in Weblogic 6.1.
and my servlet is packed in a .war file.
And i can't use getRealPath() method, as this method doesn't work if servlet is packed in .war file.
please help me
thanks in advance
Srinivas