Provide a capability to declare request, response, session and other variables in jspService function as final. As tunable feature, just like others, in tomcat`s web.xml file. Why need this feature? To use request, response, session variables in anonymous implementations of classes. For example - declaration of iterator through elements, which includes some other JSP file (statically). And usage of this iterator in other JSP file.
Created attachment 3528 [details] Patch to fix this problem, against 4.1.12 tomcat version
I have added a patch against 4.1.12 tomcat source to fix this problem. However it simply forces all to be final. Please evalute it on including in cvs tree.
The patch provided does not appear to be against Tomcat 4.1.12 or any Tomcat version from 4.1.0 to 7.0.x. I have reviewed the 7.0.x code and made variables final where I think it is safe to do so. session isn't final but you can always get that from request which is. The fix will be in 7.0.6 onwards.