Hi, In the 6.x branch of Tomcat an inconsistent naming of the JSP compiler key name for using char array type instead of String causes the compiler feature to not work. I first noticed this when looking at the generated Servlet source then using a debugger to double check. The code has been patched in the 7.x branch in rev 889966. It corrects the key name from "genStrAsCharArray" to "genStringAsCharArray" in a couple of files. http://svn.apache.org/viewvc?view=revision&revision=889966 Is it possible this individual revision can be back-ported to Tomcat 6 ? Regards, Jeremy
Steps to reproduce = ? Where and how do you configure the JSP compiler? What does not work? The correct init-parameter name in Tomcat 6 is "genStrAsCharArray" and that is documented in http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html (Though the second mention of it in "Production Configuration" section says "genStringAsCharArray", a typo.) If you use it with Ant then yes, there is an inconsistency and you would have to use <jasper genStringAsCharArray="true"/> as the setter in JspC.java is setGenStringAsCharArray(...) with no matching getter. I think backporting r889966 as is is wrong. I think EmbeddedServletOptions should ask both the old and the new init-param name, for compatibility. It also needs r1556725 and update to jasper-howto.html.
(In reply to Konstantin Kolinko from comment #1) > Steps to reproduce = ? > Where and how do you configure the JSP compiler? What does not work? Take a look at a BZ for a downstream project. It details a reproducer. https://bugzilla.redhat.com/show_bug.cgi?id=1022634 > > > The correct init-parameter name in Tomcat 6 is "genStrAsCharArray" > and that is documented in > http://tomcat.apache.org/tomcat-6.0-doc/jasper-howto.html > > (Though the second mention of it in "Production Configuration" section says > "genStringAsCharArray", a typo.) > > If you use it with Ant then yes, there is an inconsistency and you would > have to use <jasper genStringAsCharArray="true"/> as the setter in JspC.java > is setGenStringAsCharArray(...) with no matching getter. as a java dev using Tomact I would use the web deployment descriptor to configure the option. jsp-configuration/@generate-strings-as-char-arrays > > > I think backporting r889966 as is is wrong. I think EmbeddedServletOptions > should ask both the old and the new init-param name, for compatibility. true. > It also needs r1556725 and update to jasper-howto.html. yes.
Created attachment 31187 [details] Proposed patch v1 The proposed patch uses the new name of genStringAsCharArray but retains support for using genStrAsCharArray as the init param name.
The proposed patch has been applied to 6.0.x and will be included in 6.0.38 onwards.