1

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 Answers2

0

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.

Har Krishan
  • 273
  • 1
  • 11
  • My requirement is, I should not allow running new jsp in my production environment other than pre-compiled JSPs. So I need to disable compiling JSPs in tomcat. – user3413804 Mar 13 '18 at 12:57
0

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.

Parthi P
  • 65
  • 1
  • 8