I am creating a RSS Feed in a XML File in a servlet and save it to my web application. The web application server i'm using is glassfish. Basically, I would like to create a XML file and save it as "articles.rss"
I would pass in the file name as
writer.setFile(getServletContext().getContextPath() + "/articles.rss");
however when I ran the servlet, the exception caused is :
java.io.FileNotFoundException: \RSSWebApp\articles.xml (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
note: my web app's named RSSWebApp
My current problem is unable to write files to the web application.
I still could not find a way to do this, althought I know there's a way. Am I missing out something? The XML file is valid, and it can be saved on a standalone application, but when I port it to Java Enterprise, it doesnt work.