Tomcat version: 6.0.x trunk Every generated JSP has try { _jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html"); in its _jspService method. The use of JspFactory.getDefaultFactory during request processing should be avoided as it is a *static synchronized* method. I have a diff that addresses this and will attach it to this bug.
Created attachment 19537 [details] Patch to avoid invoking JspFactory.getDefaultFactory in jspService The attached patch changes the .jsp-->.java generator so that JspFactory.getDefaultFactory is invoked as a one-time operation. The patch also consolidates JspFactory initialization in JspRuntimeContext.
Created attachment 19538 [details] Difference in the generated code for hello_jsp.java before and after the patch
I did not realize this method was synchronized, so thanks for mentioning it. There doesn't seem to be any reason for that.