aspose file tools*
The moose likes JSP and the fly likes problem with Tomcat4.0.3+jstl for xml transformation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with Tomcat4.0.3+jstl for xml transformation" Watch "problem with Tomcat4.0.3+jstl for xml transformation" New topic
Author

problem with Tomcat4.0.3+jstl for xml transformation

K.Suresh Kumar
Ranch Hand

Joined: Nov 21, 2007
Posts: 41
Hi Friends,
I,m trying to use jstl with Tomcat4.0.3 for transforming xml to html using xslt. The problem is while i load the page to transform i get the error which says uri http://java.sun.com/jstl/xml cannot be resolved either by web.xml or standard.jar but actually iuse all the required jars(xalan.jar, standard.jar, jstl.jar, serialization.jar).
how to resolve this problem?

Thanks in Advance..
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Tomcat 4 supports Servlet Spec 2.3 and JSP 1.2.

Are you sure you're using the right version of JSTL for this container (version 1.0)?

In the JSP FAQ, there is a page with links to all the correct versions for each version of the Servlet/JSP specs.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
K.Suresh Kumar
Ranch Hand

Joined: Nov 21, 2007
Posts: 41
Hi Ben thanks for your reply. i have resolved the issue. the problem is, the jstl 1.0 works fine with tomcat4.0.4 and higher versions but not with the Tomcat4.0.3 due to a bug. the way around is according to jstl 1.0 readme document you have to download the jakarta-taglibs-standard-oldxml-compat.zip and put the jar files inside WEB-INF/lib directory.

But now i have another issue to solve. the jsp page which has the transformation jstl implementation loaded but doe's not display any html. insted it display's a empty page. what is this problem and could you help me again?

once again Thanks a lot..
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by K.Suresh Kumar:
transformation jstl implementation loaded but doe's not display any html. insted it display's a empty page. what is this problem and could you help me again?


The first thing I do when I see an empty browser window is use the "view source" feature to look at the HTML. Often the problem is just a mistake in the HTML.

If there really isn't any source going to the browser, then I look at the server's logs to see what if anything blew up. If I still didn't find anything then I would start stepping through the code to try to figure out what the problem is.
K.Suresh Kumar
Ranch Hand

Joined: Nov 21, 2007
Posts: 41
Ben as you mention in the reply i found that the problem is in xslt file which has <script/> part inside it. if remove that then it displays html page correctly.

again i need that <script> part also in my xslt i have given both the xslt files snippet here check it out.

==========================================================================
the on which does not diplay html but if i use the view source i can see that it is writing to the browser but not displayed as html,
==========================================================================

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/clients/client[@id]">
<xsl:if test="@id = 088115">
<html>
<body>
<table bgcolor="#FFFFFF" border="0" cellpadding="3" cellspacing="0" width="133%">
<tbody>
<tr>
<td>
<script language="JavaScript" src="../common/demoedit.js"/>
</td>
</tr>
<tr>
<td>
<b>Owner:</b>
<xsl:if test="data/owner/@show = 'true'">
<xsl:value-of select="data/owner"/>
</xsl:if>
</td>
</tr>
</tbody>
</table>
</body>
</html>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

=======================================================
the one which works fine,
=======================================================

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/clients/client[@id]">
<xsl:if test="@id = 088115">
<html>
<body>
<table bgcolor="#FFFFFF" border="0" cellpadding="3" cellspacing="0" width="133%">
<tbody>
<tr>
<td>
<b>Owner:</b>
<xsl:if test="data/owner/@show = 'true'">
<xsl:value-of select="data/owner"/>
</xsl:if>
</td>
</tr>
</tbody>
</table>
</body>
</html>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

Thanks..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with Tomcat4.0.3+jstl for xml transformation