Hello. I've looked through the archives, but I haven't seen a solution to
this problem. I'm using XSLT to create a JSP page and to get that to work,
I am using Tomcat 4.0 Release Candidate 1 (on a Windows 2000 box, only
running Tomcat--no Apache nor IIS). But the simple tests of the XML-version
of JSP I'm using seems to process all the scriplets first, and then the
HTML. For instance, this code in regular JSP format returns the right
results:
<%
int a = 15;
%>
<html><head><title>hi there</title></head>
<body>
Hi. My variable is: <%=a%>. <br />
<% out.println("I like mongeese!<br />"); %>
</body></html>
******the results*******************
Hi. My variable is: 15.
I like mongeese!
**********************************
While the XML-style, which looks like this:
<?xml version="1.0" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
version="1.2">
<jsp:scriptlet>
int a = 15;
</jsp:scriptlet>
<html><head><title>test</title></head>
<body>
Hi everyone! The number is: <jsp:expression>a</jsp:expression>.<br />
<jsp:scriptlet>
out.println("I like the mongoose!<br />");
</jsp:scriptlet>
</body></html>
</jsp:root>
Returns this:
****************************
15
I like the mongoose! Hi everyone! The number is: .
****************************************
I attempted to add a namespace to my HTML tags in the XML version; however,
when I tried to run that version, I received an exception saying that the
URI I was using (http://www.w3.org/1999/xhtml) was not resolvable:
***********************
org.apache.jasper.JasperException: This absolute uri
(http://www.w3.org/1999/xhtml) cannot be resolved in either web.xml or the
jar files deployed with this application
************************
So my questions are:
1) How do I get Jasper to resolve the namespace URI? (I'm assuming that I
have to stick a line in web.xml?)
2) How do I get Tomcat to render XML-style JSP in the right order, just as
regular style JSP renders?
Thank all of you very much for your assistance in these questions.
James Smith