tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Majors, Jeremy" <>
Subject GetRealPath Alternative for WAR Deployment
Date Thu, 01 Aug 2013 15:45:48 GMT
I've seen multiple postings online that state that when you deploy a WAR file rather than using
an exploded WAR, then the request.getServletContext().getRealPath() method returns null. 
Due to a requirement by my team lead, I cannot deploy the application in any other fashion
besides a precompiled WAR file (deploying a folder fixes this issue) and I was using the request.getServletContext().getRealPath()
 method so that I could get the version # of the WAR that I have deployed (ex:  myWAR##001.war).
 Is there another way to get the version number?  I also looked online to see if there was
a way to get the docBase parameter from the context file, but all the postings for that said
to use request.getServletContext().getRealPath(), which is returning null.

Any guidance would be greatly appreciated.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message