Bug 55671 - Backport genStringAsCharArray patch to Tomcat 6.x branch.
Backport genStringAsCharArray patch to Tomcat 6.x branch.
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Jasper
6.0.37
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
: PortBack
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2013-10-18 16:18 UTC by Jeremy Whiting
Modified: 2014-01-14 09:35 UTC (History)
0 users



Attachments
Proposed patch v1 (7.41 KB, patch)
2014-01-09 10:23 UTC, Mark Thomas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Whiting 2013-10-18 16:18:54 UTC
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
Comment 1 Konstantin Kolinko 2014-01-09 05:52:28 UTC
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.
Comment 2 whitingjr 2014-01-09 08:42:06 UTC
(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.
Comment 3 Mark Thomas 2014-01-09 10:23:22 UTC
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.
Comment 4 Mark Thomas 2014-01-14 09:35:31 UTC
The proposed patch has been applied to 6.0.x and will be included in 6.0.38 onwards.