Originally posted by pradeep raju:
ServletContext ctxt=config.getServletContext();
System.out.println("path "+ctxt.getRealPath("/"));
iam getting null pointer exception..
i dont know the reason behind this
Is your web application root directory part of the file system, or is it in a war file? The javadoc for ServletContext getRealPath mentions this:
This method returns null if the servlet container cannot translate the virtual path to a real path for any reason (such as when the content is being made available from a .war archive).