PDA

View Full Version : configure tomcat to reload after xml change


pete139
04-04-2011, 14:53
I am running a jsp page (with some jar files) on a Tomcat webserver. On the page I am updating a XML file on the server based on the users input. The XML file is successfully updated (as I can see the new lines when opening the file) but I can not access the inserted data through my jsp page afterwards. Only after restarting the server manually it detects the changes in the xml file and I can display the xml-data online.

I read somewhere that a parameter called reloadable can be set in the context.xml file in the META-INF folder of the webapp, but it seems that it only detects changes in java class files and not in manipulated XML files.

Is there a way to let the server know about the changes in the XML file and recompile the jsp files automatically?

Thanks,

Pete

Kees de Kooter
04-04-2011, 19:47
Please show us the code that reads the inserted data.

kjkoster
04-04-2011, 20:59
Dear Pete,

Check the cache control HTTP headers to see that the XML file is actually requested through Tomcat.

Reloadable reloads the entire web-app, which is a terrible idea to trigger on user input.

Kees Jan