Solved

jsp page with XML and XSLT

Posted on 2006-07-05
13
608 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
modThree challenge 4 64
instanceof  operator in java 26 73
Fix45 challenge 15 88
count7 challenge 12 70
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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

746 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

12 Experts available now in Live!

Get 1:1 Help Now