How to disable JSP Compilation during runtime in tomcat

1.7k Views Asked by At

I need to disable jsp compilation during runtime. I already have pre-compiled all the jsp files into the product. In production environment I do not want any new jsp to run.

2

There are 2 best solutions below

1
Har Krishan On

By default a JSP will only be complied once until you changes it. You have nothing to do for achieving that. For your confirmation you can call a JSP first time and you will observe that it took much time than when you will call the same (unmodified) JSP second time.

0
Parthi P On

You can use jasper2 production configuration to disable the JSP compilation at runtime.

Refer : https://tomcat.apache.org/tomcat-8.0-doc/jasper-howto.html#Production_Configuration

Setting development=false will solve your problem.