tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: EL and TCK
Date Fri, 19 Sep 2008 17:28:33 GMT
Konstantin Kolinko wrote:
> Mark,
> I tend to agree with your reading of the EBNF grammar there, but I think that
> the grammar is wrong.
Unfortunately, we have to implement the spec. If we think it is wrong we
can ask the EG for a clarification but in the mean time we should be compliant.

> The first sentence of "Quoting in Attributes" part in JSP.1.6 says:
> "Quotation is done consistently regardless of whether the attribute value is a
> literal or a request-time attribute expression."
> <x:tag value="${"Joe said 'hello'"}"/>
> is not a consistent quoting, IMHO.
Indeed, but the spec also states that the grammar has precedence over the text.

> Also, from historical perspective, do you think that quoting rules has changed
> between JSP 1.2 and 2.0?
I don't know. My brain hurts enough from just the 2.1 spec - I don't think
I can face reading another one ;)

> So, the error in EBNF is also present in JSP 2.0.

> Implementation of JSP 2.0 can be tested with Tomcat 5.5, and the following:
> <%@ taglib prefix="c" uri=""%>
> <c:out value="${ \"Joe said 'hello'\" }" />
> prints the string in TC 5.5.25, and the expression without the slashes produces
> error 500 ("equal symbol expected") at compile time.
6.0.x usually fails in the same way but it isn't always consistent. Before
it is fixed, we need to figure out what the correct behaviour is.

> I do not have "strict
> compliance" configured, if that matters.
I don't believe it does in this case.

> I also thought, how the error in the EBNF grammar could be corrected, but
> the most simple way IMHO would be to explain the issue in a comment, or
> replace the reference to EL grammar (inclusion of it) with a vc: validity
> constraint (JSP.,
> rather than to try to express it all as pure EBNF productions.
I'm not sure it should be fixed. See
If quoting was applied consistently things would have to be double escaped.
You'd have tag attributes of the form
which equates to the EL
which evaluates to

With the current grammar you'd have tag attributes of the form
which equates to the EL
which evaluates to

I find the latter easier to read although the trick is how you parse it. I
need to have a think about edge cases, particularly with quoted }, to see
if the current grammar can be parsed unambiguously.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message