I don't really understand why you need the temp files? The normal approach
is to store the static template files somewhere (classpath or database etc)
but never actually store the merge results (template merged with context).

I think you should provide a page which returns a StreamResult which is the
merged html and serve that page in your iframe. No temp files needed, just
generate on the fly.

If you decide you want to cache the results to disk, use one of the many
cache implementations out there rather than rolling your own.
On 23 Mar 2015 22:51, "Poggenpohl, Daniel" <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello,
>
> perhaps you people can help me...my application has various resources
> deployed. Among them are a kind of HTML template files. I take the files,
> replace part of the contents of the file according to a certain syntax, and
> want to display the resulting html file in an iframe on a Tapestry page.
>
> To do this, I am currently creating temporary html files. I use the
> createTempFile method of java.nio.Files. Those temporary files are thus
> stored locally on each user's pc. But when I want to display the generated
> HTML file, I have to use File://<File:///\\> as a prefix, which probably
> doesn't work with my browser.
>
> How would you create temporary files inside the servlet container so that
> you could access them using ServletContext or whatever necessary?
>
> Regards,
> Daniel
>
> --
> Dipl. Inf. Daniel Poggenpohl, Fraunhofer-Institut für Software- und
> Systemtechnik ISST
> Compliance- und Sicherheitslösungen
> Emil-Figge-Straße 91, 44227 Dortmund, Germany
> Telefon: +49 (0) 231 / 9 76 77-323
> mailto: daniel.poggenp...@isst.fraunhofer.de<mailto:
> daniel.poggenp...@isst.fraunhofer.de>
> http://www.isst.fraunhofer.de<http://www.isst.fraunhofer.de/>
>
>

Reply via email to