You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alexey Naidyonov <gr...@tula.net> on 2003/11/17 19:35:13 UTC

[Tomcat 5.0.14] JSP 2.0 XML syntax and EL expressions bug.

Hi.

It appears that certain JSP 2.0 EL expressions may or may not work
depending on choosen JSP syntax. E.g., the expression

  <td>${param['foo']}</td>

is ok for standard syntax, but will result into
org.apache.jasper.JasperException: /test.jsp() Unterminated ${ tag
exception with XML syntax page.

I believe the problem is withing JspDocumentParser.java code. The
characters() function assumes that the parser always passes the content
of a text node with a single call which is not always the case.
Actually, org.xml.sax.ContentHandler API specifies that "SAX parsers may
return all contiguous character data in a single chunk, or they may
split it into several chunks". Moreover, it splits text nodes content
into several chunks whenever it meets '[' or ']' within the node, so the
code fails to parse any correct EL expression using array access syntax.

Please suggest fix or workaround. Unfortunately using standard syntax
wouldn't work for me, I stuck to xml.

-- 
Alexey Naidyonov <gr...@tula.net>
Growler Home


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


Re: [Tomcat 5.0.14] JSP 2.0 XML syntax and EL expressions bug.

Posted by Tim Funk <fu...@joedog.org>.
To get this fixed the quickest, please submit a bug report 
(http://nagoya.apache.org/bugzilla/) with the following:
- File where it works (non-xml syntax)
- File where it doesn't works (xml syntax)
- Your explanation below.
- And if your daring (a PATCH, or the code where jasper2 is incorrect)


-Tim

Alexey Naidyonov wrote:
> Hi.
> 
> It appears that certain JSP 2.0 EL expressions may or may not work
> depending on choosen JSP syntax. E.g., the expression
> 
>   <td>${param['foo']}</td>
> 
> is ok for standard syntax, but will result into
> org.apache.jasper.JasperException: /test.jsp() Unterminated ${ tag
> exception with XML syntax page.
> 
> I believe the problem is withing JspDocumentParser.java code. The
> characters() function assumes that the parser always passes the content
> of a text node with a single call which is not always the case.
> Actually, org.xml.sax.ContentHandler API specifies that "SAX parsers may
> return all contiguous character data in a single chunk, or they may
> split it into several chunks". Moreover, it splits text nodes content
> into several chunks whenever it meets '[' or ']' within the node, so the
> code fails to parse any correct EL expression using array access syntax.


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