Bug 27584 - Tag attributes need escaping of EL quotes
Summary: Tag attributes need escaping of EL quotes
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 5.0.18
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-10 21:10 UTC by Juergen Weber
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Weber 2004-03-10 21:10:28 UTC
I tried to use a map based EL expression

${folder.variables["copyright"]}

as Tag attribute like 

<jg:if exists="${folder.variables["copyright"]}">

But there was a JasperException "equal symbol expected"

When I included backslashes, it worked: 

<jg:if exists="${folder.variables[\"copyright\"]}">

I did find nothing in the JSP 2.0 spec about having to escape quotes in
Tag attributes, especially as in normal usage it is not necessary.

At least the error message is not very helpful.
Comment 1 Tim Funk 2004-03-17 15:45:37 UTC
This would be a problem since tomcat4 using JSTL too. 

An alternative is to mix your quotes. But the error message does state where in
the JSP file there is an error.

At best this could be an enhancement.
Comment 2 Kin-Man Chung 2004-03-17 18:29:02 UTC
JSP.1.6 defines rules for quoting and escape conventions.  Any attributes,
including ELs, must follow these rules.

The error message is not perfect, but it usually includes line column numbers,
which should let you locate the problems.