You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Carlos Gaston Alvarez <ga...@tournet.com.ar> on 2001/05/25 15:35:43 UTC

syntax inside syntax

    I cannot find the original mail, so I am trying to remember.

    I remember that some time ago there was an error reported that when the
jsp compiled found something like

out.writeln( "....%>" );

it took the %> as a directive and not as part of the code.  (the end of the
scriptlet).

    It was said that that should get fixed, but I dont think so.

    To correct this means to check if in the scriptlet the java syntax is
correct and doing so adds lots of time and complexity. Also in the jsp
specification (been reading 1.2) it says that it should be scaped as %\>.
See page 42 of jsp 1.2 section 2.6 public draft 2. Also see page 58 section
2.11.2

The correct answer should be:
out.writeln( "....%\>" );

    I aslo means a problem because in the future we may support another
language like Jython (Python) and complexity grows.

    Well, we are facing the problem of having a syntax inside another
syntax. We should then not consider this an error and encourage the
programmer to take another path of action. Anyway, I consider that taking
diferents scape sequences together (jsp+java) a little messy.

posible solutions:

out.writeln( "....\u####>" );  // sorry, dont remember the number.
out.writeln( "....%"+">" );


Chau,

Gaston