You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sam Hough <sa...@redspr.com> on 2003/09/06 19:10:26 UTC

JSP Document

Tomcat 4.1.27 on Win32 given

<?xml version="1.0"?>
<jsp:root xmlns=http://java.sun.com/JSP/Page version="1.2">
    <h1>Cat &amp; Dog</h1>    
</jsp:root>

Generates

<h1>Cat & Dog</h1>

Can anybody confirm that this is correct behaviour?

I can sort of see that it makes sense (JSP is for generating any character 
stream...) but it does make a JSP Document look very odd.

Also, is it correct that  <jsp:directive.include file="some jsp"/> should
not allow namespaces to be redelcared? 

Sorry if both these things are clear in the spec. Ive read it but
dont feel much wiser.

Thanks

Sam

RE: JSP Document

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
Other solution:

<...>
Cat <![CDATA[&amp;]]> Dog
</...>

Especially handy when using large portions of "Normal" text

-----Original Message-----
From: Sam Hough [mailto:sam@redspr.com] 
Sent: zaterdag 6 september 2003 19:40
To: Tomcat Users List

Can still produce valid XHTML by doing

Cat &amp;amp; Dog

But double escaping is not very friendly. I like the fact that JSP
lets you generate any format HTML, XHTML, plain text and being
able to write templates in XML but this is a bit ugly.

Just want to check that it is meant to be this way before I learn 
how it all works. Seems like they are sticking to "JSP generates
anything" since the JSP 2.0 syntax ${some.thing} doesnt escape
XML.

I think Ive spent too much time with XSL ;)


----- Original Message ----- 
From: "Eugene Lee" <li...@fsck.net>
To: <to...@jakarta.apache.org>
Sent: Saturday, September 06, 2003 6:23 PM
Subject: Re: JSP Document


> On Sat, Sep 06, 2003 at 06:10:26PM +0100, Sam Hough wrote:
> : 
> : Tomcat 4.1.27 on Win32 given
> : 
> : <?xml version="1.0"?>
> : <jsp:root xmlns=http://java.sun.com/JSP/Page version="1.2">
> :     <h1>Cat &amp; Dog</h1>    
> : </jsp:root>
> : 
> : Generates
> : 
> : <h1>Cat & Dog</h1>
> : 
> : Can anybody confirm that this is correct behaviour?
> 
> Why did the "&amp;" entity get changed to a plain "&" character?  That's
> not kosher with HTML-4.01 specs.
> 
> 
> -- 
> Eugene Lee
> http://www.coxar.pwp.blueyonder.co.uk/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

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





Re: JSP Document

Posted by Sam Hough <sa...@redspr.com>.
Can still produce valid XHTML by doing

Cat &amp;amp; Dog

But double escaping is not very friendly. I like the fact that JSP
lets you generate any format HTML, XHTML, plain text and being
able to write templates in XML but this is a bit ugly.

Just want to check that it is meant to be this way before I learn 
how it all works. Seems like they are sticking to "JSP generates
anything" since the JSP 2.0 syntax ${some.thing} doesnt escape
XML.

I think Ive spent too much time with XSL ;)


----- Original Message ----- 
From: "Eugene Lee" <li...@fsck.net>
To: <to...@jakarta.apache.org>
Sent: Saturday, September 06, 2003 6:23 PM
Subject: Re: JSP Document


> On Sat, Sep 06, 2003 at 06:10:26PM +0100, Sam Hough wrote:
> : 
> : Tomcat 4.1.27 on Win32 given
> : 
> : <?xml version="1.0"?>
> : <jsp:root xmlns=http://java.sun.com/JSP/Page version="1.2">
> :     <h1>Cat &amp; Dog</h1>    
> : </jsp:root>
> : 
> : Generates
> : 
> : <h1>Cat & Dog</h1>
> : 
> : Can anybody confirm that this is correct behaviour?
> 
> Why did the "&amp;" entity get changed to a plain "&" character?  That's
> not kosher with HTML-4.01 specs.
> 
> 
> -- 
> Eugene Lee
> http://www.coxar.pwp.blueyonder.co.uk/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

Re: JSP Document

Posted by Marco Tedone <mt...@jemos.org>.
Actually I think it is, at least according to the HTML 4.01 Transitional.
These are character entities and must be entered with the 'escape'
character. These can assume a number or a character after the escape
character. The only character which in some browsers is not rendered
properly is the TM (trade mark) symbol, which doesn't have an 'escape'
character representation, but only a numeric one (&153;). In this scape the
form:

<sup><small>TM</small></sup>

is used. I can confirm also that the &amp; is XHTML 1.0 Transitional valid.

Hope this will help,

Marco

----- Original Message ----- 
From: "Eugene Lee" <li...@fsck.net>
To: <to...@jakarta.apache.org>
Sent: Saturday, September 06, 2003 6:23 PM
Subject: Re: JSP Document


> On Sat, Sep 06, 2003 at 06:10:26PM +0100, Sam Hough wrote:
> :
> : Tomcat 4.1.27 on Win32 given
> :
> : <?xml version="1.0"?>
> : <jsp:root xmlns=http://java.sun.com/JSP/Page version="1.2">
> :     <h1>Cat &amp; Dog</h1>
> : </jsp:root>
> :
> : Generates
> :
> : <h1>Cat & Dog</h1>
> :
> : Can anybody confirm that this is correct behaviour?
>
> Why did the "&amp;" entity get changed to a plain "&" character?  That's
> not kosher with HTML-4.01 specs.
>
>
> -- 
> Eugene Lee
> http://www.coxar.pwp.blueyonder.co.uk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>




Re: JSP Document

Posted by Eugene Lee <li...@fsck.net>.
On Sat, Sep 06, 2003 at 06:10:26PM +0100, Sam Hough wrote:
: 
: Tomcat 4.1.27 on Win32 given
: 
: <?xml version="1.0"?>
: <jsp:root xmlns=http://java.sun.com/JSP/Page version="1.2">
:     <h1>Cat &amp; Dog</h1>    
: </jsp:root>
: 
: Generates
: 
: <h1>Cat & Dog</h1>
: 
: Can anybody confirm that this is correct behaviour?

Why did the "&amp;" entity get changed to a plain "&" character?  That's
not kosher with HTML-4.01 specs.


-- 
Eugene Lee
http://www.coxar.pwp.blueyonder.co.uk/

Re: JSP Document

Posted by Bill Barker <wb...@wilshire.com>.
My reading of the JSP spec says that Tomcat is correct here.  If you need to
preserve the escape, then follow Sjoerd's suggestion.

"Sam Hough" <sa...@redspr.com> wrote in message
news:003501c37499$c45be180$0300a8c0@mabel...
> Tomcat 4.1.27 on Win32 given
>
> <?xml version="1.0"?>
> <jsp:root xmlns=http://java.sun.com/JSP/Page version="1.2">
>     <h1>Cat &amp; Dog</h1>
> </jsp:root>
>
> Generates
>
> <h1>Cat & Dog</h1>
>
> Can anybody confirm that this is correct behaviour?
>
> I can sort of see that it makes sense (JSP is for generating any character
> stream...) but it does make a JSP Document look very odd.
>
> Also, is it correct that  <jsp:directive.include file="some jsp"/> should
> not allow namespaces to be redelcared?
>
> Sorry if both these things are clear in the spec. Ive read it but
> dont feel much wiser.
>
> Thanks
>
> Sam