tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <wbar...@wilshire.com>
Subject Re: jsp 1.2 and escaping quote marks
Date Thu, 11 Sep 2003 05:52:38 GMT
Does this work:
  <img src="foo.jpg" alt="My &quot;quoted&quot; text." />

"Rich Unger" <RichUnger@netbeans.org> wrote in message
news:pan.2003.09.11.00.29.00.609000@netbeans.org...
> <?xml version="1.0" encoding="utf-8"?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
>    <html>
>       <img src="foo.jpg" alt='My "quoted" text.'/>
>       <img src="foo.jpg" alt="My &quot;quoted&quot; text."/>
>       <img src="foo.jpg" alt="My &#34;quoted&#34; text."/>
>    </html>
> </jsp:root>
>
> All 3 of these lines cause compile errors.  I'm using XSLT to generate
> files which _may_ be JSP files (they may be static files, it's determined
> when the xslt runs).  Because of this, I'm not particularly enthused about
> manually sticking backslashes in front of my quote characters.
>
> What I want to know is, how does tomcat 4 know to escape the quote marks
> around foo.jpg, as in:
>
>       out.write("<img src=\"foo.jpg\" alt='My "quoted" text.'/>");
>
> ...but not around "quoted"?  Is it a bug, or is this an expected compile
> error in my jsp?
>
> Thanks,
> Rich




Mime
View raw message