Solved

jsp page with XML and XSLT

Posted on 2006-07-05
13
609 Views
Last Modified: 2013-11-24
hi,
  I'm following this tutorial to get XML and XSLT files to work with JSP page and followed all the instructions correctly and rechecked them. However when I try to view the JSP page I get this error.

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.taglibs.xsl.ImportTei
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause
0
Comment
Question by:BrijBhasin
  • 7
  • 6
13 Comments
 
LVL 5

Expert Comment

by:jpolin1
ID: 17043897
Do you have the TLD and jar files for that tag library in the right spot?
0
 

Author Comment

by:BrijBhasin
ID: 17044178
I copied the tag-lib jar in the lib folder
http://www.webreference.com/xml/column37/2.html

Now, I'm getting this error.  
org.apache.jasper.JasperException: /book.jsp(5,0) No tag "InsertWithXSL" defined in tag library imported with prefix "xsl"
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17044255
Did you put xsl.tld in the WEB-INF directory?
0
 

Author Comment

by:BrijBhasin
ID: 17044275
yes I do
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17044287
Could you paste the jsp in question up here? book.jsp ? Thanks
0
 

Author Comment

by:BrijBhasin
ID: 17044664
<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl"%>
<html>
<head><title>Phone Book</title></head>
<body>
<xsl:InsertWithXSL xml="/xml/book.xml" xsl="/xml/book.xsl" />
</body>
</html>
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 5

Expert Comment

by:jpolin1
ID: 17044792
I think the InsertWithXSL tag has been removed from that library.
Look in your TLD file for insertWithXSL, if its not there then the version of the tag library you downloaded doesn't contain that tag anymore.

Try replacing it with the apply tag, like below:

<%@taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl"%>
<html>
<head><title>Phone Book</title></head>
<body>
<xsl:apply xml="/xml/book.xml" xsl="/xml/book.xsl" />
</body>
</html>
0
 

Author Comment

by:BrijBhasin
ID: 17045624
I changed it to apply - <xsl:apply xml="/xml/book.xml" xsl="/xml/book.xsl" />
and now I get this error
javax.servlet.ServletException: org/apache/xalan/xslt/XSLTInputSource
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
0
 
LVL 5

Accepted Solution

by:
jpolin1 earned 500 total points
ID: 17045633
Looks like maybe its compaining about the location of book.xsl.
Make sure that is in the right spot, and maybe play around with the path, like "xml/book.xsl"
or put a Fully qualified path to the xsl .
0
 

Author Comment

by:BrijBhasin
ID: 17045935
I have tried all combinations and even moved all my files in the same directory but still getting this error .. any more ideas..thanks.
0
 

Author Comment

by:BrijBhasin
ID: 17051526
This works.  ..
<%@ taglib uri="http://java.sun.com/jstl/xml"  prefix="x" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<html >
  <head>
    <title>XSLT Test</title>
  </head>

  <body>
    <c:import url="F.xml" var="inputDoc" />
    <c:import url="F.xsl" var="stylesheet" />

    <x:transform xml  = "${inputDoc}" xslt = "${stylesheet}">
    </x:transform>
  </body>


</html>
Also make sure that the xsl and xml are created in the same editor... my xml wasn't being transformed initially by this because of this weird reason.
0
 
LVL 5

Expert Comment

by:jpolin1
ID: 17051539
glad to here its working
0
 

Author Comment

by:BrijBhasin
ID: 17051595
Thanks for all your help jpolin1
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MaxSpan challenge 9 82
endX challenge 2 63
word0 challenge 4 66
stackato and cloud 4 73
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now