Problem with XML output by a jspx file

Y

yzzzzz

Hi,

I'm using Tomcat 5.5 under Linux.
Here is a sample JSP file:
<html>
<body>
a &amp; b
</body>
</html>


1. When I name this file "test.jsp" I get the following output in my
browser:
<html>
<body>
a &amp; b
</body>
</html>
That's fine.

2. When I name this file "test.jspx" I get the following output in my
browser:
<?xml version="1.0" encoding="UTF-8"?>
<html><body>
a & b
</body></html>
This is invalid. The ampersand should be escaped as &amp;. Here the
output is not well-formed XML, which causes multiple problems. (Note: I
really don't mind the parser ignoring white-space or adding an XML
processing instruction at the top.)

Is this some kind of bug, is there a work-around (apart from writing
&amp;amp;), or is there something wrong in my tomcat configuration?

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top