Here is my situation:
My table must have an button to show images, I am inserting data in database containing only the name of the image file (filename.jpg) and not an specific path, the server will show it based in what context it is in real server or not. For it after a long search I found the method
getServletContext().getRealPath("/images")
who finds the context where the paste is located, for example local host or real one (at least that's what I understood).
But, when I am at localhost it's showing this context for the method
getServletContext().getRealPath("/images"):
C:\Documents and Settings\josue\Meus documentos\workspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\testeDeFuncoes\images\file.jpg
I deduce it's calling context of a temporary folder, that was made only for localhost test. To recover it in localhost I think will work, but in real server will work it work, I think not, right?
Can I put in Webcontent in dynamic way that when I export WAR file it is stored in file and when upload it works no matter of what location server decides to choose. If not, what is generally used to do it a webpage in the most cases?