Solved

jsp page with XML and XSLT

Posted on 2006-07-05
13
613 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapBully challenge 6 178
word0 challenge 4 72
Setting strict transport security header in header not working 1 126
eclipse compiler vs Installed JREs option 3 112
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
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.

726 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