You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Olaf Kock <to...@olafkock.de> on 2020/03/24 17:07:35 UTC

Re: Is it possible to programmatically compile jsp files?

On 24.03.20 15:44, Jonathan Yom-Tov wrote:
> I have a set of jsp files. These jsps' compilation result changes whenever
> a variable in my cache changes. I want to compile them whenever that
> variable changes so they're ready to serve without going through the normal
> pipeline. Is that possible?
>
Sounds a lot like you're runtime-generating JSPs. I'd rather recommend
to implement a taglib or some other means to generate output dependent
on your cache's content.

At least I can't come up with a different idea for why a compilation
result would depend on some runtime data.

With runtime generation, you might easily run into concurrency issues,
e.g. requesting a JSP while it's overwritten, and only half of the file
is generated (or the file is not yet readable). This would leave a
compiler error, and if the timestamp doesn't update any more, leave you
with a weird result.

Is it possible? Sure. Is it likely the right solution to your problem: I
doubt (until proven opposite)

Olaf


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org