Yes, I see what you mean.  I guess it is a matter of what happen first.
If the escape happens first, then the JSP

<% String foo = "testing %\>"; %>

would be translate to the following java code

String foo = "testing %>";

Then it would be valid java code.

However, it seems to me in Tomcat, the translation happens first so the
following
invalid java code is generated:

String foo = "testing %\>";


Bill

"Craig R. McClanahan" wrote:

> William Au wrote:
>
> > I was inside a scriplet, setting up a string that contains the character
> > "%>":
> >
> > <%
> > String foo = "testing %\>";
> > %>
> >
> > I ended up doing:
> >
> > <%
> > String foo = "testing %" + ">";
> > %>
> >
> > But the first code segment should work according to the JSP 1.1 spec.
> >
>
> Except for a second requirement -- that the code you include in
> scriptlets
> needs to conform to the syntax and semantic requirements of the
> scripting
> language (Java, in this case).  In the JSP 1.2 spec, that's in Section
> 6.1; I
> don't have the 1.1 spec in front of me, but I believe that it contained
> similar language.
>
> >
> > Bill
>
> Craig
>
> >
> > "Craig R. McClanahan" wrote:
> >
> > > William Au wrote:
> > >
> > > > I am having trouble with quoting in scripting elements with Tomcat
> > > > 3.2.1.
> > > >
> > > > "%\>" does not work for quoting "%>" as defined in section 2.4 for
> > > > JSP 1.1 spec.
> > > >
> > > > Any way to get around it?
> > > >
> > >
> > > Where are you trying to use this escape?
> > >
> > > If you are inside a string literal in a scriptlet, you should be aware
> > > that "\%" is not legal syntax for a Java string, so you are still going
> > > to have problems.
> > >
> > > >
> > > > Bill
> > > >
> > >
> > > Craig McClanahan
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, email: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to