tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
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.
<sarcasm>Great</sarcasm>

> Implementation of JSP 2.0 can be tested with Tomcat 5.5, and the following:
> 
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
> <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.1.3.10.2),
> rather than to try to express it all as pure EBNF productions.
I'm not sure it should be fixed. See
https://issues.apache.org/bugzilla/show_bug.cgi?id=45451
If quoting was applied consistently things would have to be double escaped.
You'd have tag attributes of the form
attr="${\"\\\\\\\"\"}"
which equates to the EL
${"\\\""}
which evaluates to
\"

With the current grammar you'd have tag attributes of the form
attr="${"\\\""}"
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.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message