I have a Java EE application that takes XML and applies XSLT to it to generate HTML. This process happens in a custom servlet. This is typically used to build portions of the content on certain web pages. Since the actual data is already stored as XML it made sense to just do transformations in a servlet.
This was actually modeled on how CruiseControl does it's build reports. The servlet caches the generated HTML to keep from incurring the costs of transformation every time. The DOM representing the XSL file is also cached in memory.
Right now the XSLT is deployed inside the WAR file. We would like to support a default XSLT deployed in the WAR file, but also the ability to update just the XSLT without re-deploying the entire app. I'm hoping some folks might have some good ideas for solving this sort of problem.
Update
From the comment(s) I've received I realize there are some server specific ways to do this. But I'm hoping to solve it in a more generic way. I need to make sure I'm able to keep the following features...
- Once a new XSLT is detected, cache the XSLT itself (until a new version is detected)
- Keep cached versions of the generated HTML, updating them when there is a new XSLT.