I have a web project in Eclipse that is generating an xml file using dom4j methods. The file lands in the WebContent folder, and the filename is sent to the mygrid.loadXML() method. The filename passed is defined relative to the context root (e.g. “/webproject/data/folder/filename.xml”). When the page loads, I get an “Incorrect XML” message. If I then refresh the project in Eclipse, so that the new xml file appears in the project explorer panel, the page will load correctly.
I have tried moving the files to different locations with no success. Instinctively it seems like using an absolute file path would work, but it does not look like the loadXML() method accepts such a parameter.
How do I make the loadXML() method aware of the newly created document without having to manually refresh the web project? Even restarting the server has no effect, I have to refresh the project itself.