I have some dynamically generated jsp content I'd like to (jstl) c:import
into another jsp page. Currently I have the dynamically generated jsp written to a file in the servlet temp directory (javax.servlet.context.tempdir
) but can't work out how I can import it since it is outside the servlet context.
Is there a way to import a jsp from the servlet temp directory, or can I somehow pre-process the jsp content without it having to be written to a file?
Previously I had this written to a file in the servlet context using getRealPath()
, but obviously it won't work in all deployments.
Thanks for any help!
[update] Ok, so I can't write a file except under a temp directory, and I can't use a jsp directly from a temp directory. Is there a way of passing the jsp content to the default jsp servlet directly to get the HTML output? How do you typically use dynamically generated jsp files? Can I implement a filter to pass in the jsp content from the tempo directory? Can I override with a HttpServletResponseWrapper or something?