Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87E549BFC for ; Thu, 15 Dec 2011 00:36:23 +0000 (UTC) Received: (qmail 5333 invoked by uid 500); 15 Dec 2011 00:36:22 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 5261 invoked by uid 500); 15 Dec 2011 00:36:22 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 5252 invoked by uid 99); 15 Dec 2011 00:36:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2011 00:36:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2011 00:36:13 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id DDA074EFF2; Thu, 15 Dec 2011 00:35:52 +0000 (UTC) From: bugzilla@apache.org To: dev@tomcat.apache.org Subject: DO NOT REPLY [Bug 52335] New: Tomcat escapes all the \% in Template Text as %. Date: Thu, 15 Dec 2011 00:35:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Tomcat 5 X-Bugzilla-Component: Jasper X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zhanglili@cn.fujitsu.com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: dev@tomcat.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 https://issues.apache.org/bugzilla/show_bug.cgi?id=3D52335 Bug #: 52335 Summary: Tomcat escapes all the \% in Template Text as %. Product: Tomcat 5 Version: 5.5.34 Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Jasper AssignedTo: dev@tomcat.apache.org ReportedBy: zhanglili@cn.fujitsu.com Classification: Unclassified hi, I noticed that there is a problem at the % escape on Tomcat 5.5.34. (1)The problem The JSP Specification 2.0 says: ------ JSP.1.6 Quoting and Escape Conventions =E2=86=92 Quoting in Template Text =E3=80=80=E3=83=BBA literal <% is quoted by <\% ------ But the result of the % escape on Tomcat 5.5.34 is : ------ Not only the \% of <\% is escaped as %. All the \% in Template Text is escaped as %. ------ If I want to show \% on the HTML page, it is needed to write \\% in a J= SP file. The problem also occurs on Tomcat 5.5.23 or Tomcat7.0.8. And it seems that the problem has already occured on Tomcat 5.5.0. (2)The reason The reason of the problem is that the following method is not implement= ed according to JSP Specification. =E3=83=BBThe class: org.apache.jasper.compiler.Parser =E3=83=BBThe method: void parseTemplateText(Node parent) =E3=83=BBThe part of source: ------ else if (ch =3D=3D '\\') { if (!reader.hasMoreInput()) { ttext.write('\\'); break; } // Look for \% or \$ // Only recognize \$ if isELIgnored is false char next =3D (char)reader.peekChar(); if (next =3D=3D '%' || (next =3D=3D '$' && !pageInfo.isELIg= nored())) { =E2=96=B2 ch =3D reader.nextChar(); } } ------ Is it a bug? --=20 Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=3De= mail ------- You are receiving this mail because: ------- You are the assignee for the bug.= --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org