I am trying to generate a XML file and save it in
Below is my code which uses a relative path:
File folder = new File("src/main/webapp/WEB-INF/pages/"); StreamResult result = new StreamResult(new File(folder, fileName));
It's working fine when running as an application on my local machine
But when deploying and running on server machine, it throws the below exception:
javax.xml.transform.TransformerException: java.io.FileNotFoundException C:projecteclipse-jee-luna-R-win32-x86_64eclipsesrcmainwebappWEB INFpagesmyFile.xml
getServletContext().getRealPath() as well, but it's returning
null on my server. Can someone help?