I was testing a web app on Tomcat and I basically created a 'Temp' folder in the 'Web-content' folder of the project in Eclipse. I write files to that folder in my web app by using the following code:
Expand|Select|Wrap|Line Numbers
- String imagePath = getServletContext().getRealPath("/Temp/")+"\\"+userName+".png";
When I switched to JBoss for the same application without making any changes, and after creating the 'Temp' folder in the same location, I keep facing a 'file not found' exception when I try to use the following code:
Expand|Select|Wrap|Line Numbers
- String imagePath = getServletContext().getRealPath("/Temp/")+"\\"+userName+".png";
- ImageIO.write((BufferedImage)returnValue, "jpg", new File(pathOfChart+"chart.jpg"));
Does anyone know why this is happening and/or how I could work around this?
Thanks in advance for your help.
Cheers.
Nikhil