Get real path of directory within WAR file
Hi,
I have an application that uses dtds for xml parsing. The dtds are all located in the WEB-INF/lib/dtd folder. I want to get the real path of this dtd folder so that I can pass this to the DocumentBuilder.parse method.
In the below code snippet, DTD_DIR is what I am trying to figure.
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(inputStream, DTD_DIR);
The application is packaged as a WAR file. I tried
ServletContext().getResource( "/WEB-INF/lib/dtd/ " ). However this URL does not work. The DocumentBuilder is trying to resolve the following location:
/home/testApp/dist/testApp.war!/WEB-INF/lib/dtd/Get_List.dtd
Am I having somethign wrong in the above URL?
Thanks in advance.
With regards
Ganesh

