JSP in XML syntax

E

Earth

Hi all,

I am new in JSP and Tomcat. Please forgive me if I have raised a simple question.

I am trying to write a simple JSP in XML syntax as follows.

<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="1.2">

<html><body>

<jsp:directive.page language="java" />


<jsp:declaration>
int count = 0;
</jsp:declaration>


<jsp:scriptlet>
count++;
</jsp:scriptlet>

<br>

<jsp:text>
Welcome! You are visitor number
</jsp:text>


<jsp:expression>
count
</jsp:expression>

</br>

</body></html>

</jsp:root>

However, when I access the page with IE6, I get the HTML tags in the browser.
- <html>
- <body>
<br>Welcome! You are visitor number 1</br>
</body>
</html>

It is ok when using the stand JSP syntax, for example <% %>

Do I missing anythiing here?

Please enlighten me.

Thanks in advance for any ideas or inputs.

eclifeww
 
T

Tor Iver Wilhelmsen

Do I missing anythiing here?

IE handles XML, but needs to "know" it's XML. Presumably, IE "knows"
that the .jsp extension means HTML if nothing else is stated, so it
treats the JSP tags as "junk" HTML.

Why do you need to see the XML in IE anyway? There are other XML tools
that can show it and that don't assume anything based on the filename
extension.
 
T

Tobias Schierge

Hi,
However, when I access the page with IE6, I get the HTML tags in the browser.

Use:

<jsp:directive.page contentType="text/html; charset=ISO-8859-1"/>


Regards,

Tobias
 
E

Earth

Hi Tobias,

Thanks, it works with <jsp:directive.page contentType="text/html;
charset=ISO-8859-1"/>

In fact, what does this code mean to IE?

Thanks in advance for any ideas and inputs.

eclifeww
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top