facebook

JSTL XML tags do not work! Need help.

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #249443 Reply

    awebpro
    Member

    Here is a very simple application of xml tags in JSTL.

    ****************************************

    <%@ page language=”java” import=”java.util.*” %>
    <%@ taglib uri=”http://java.sun.com/jstl/core_rt&#8221; prefix=”c” %>
    <%@ taglib uri=”http://java.sun.com/jstl/xml_rt&#8221; prefix=”x” %>
    <%@ taglib uri=”http://java.sun.com/jstl/fmt_rt&#8221; prefix=”fmt” %>

    <jsp:useBean id=”today” class=”java.util.Date” />

    <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    </head>

    <body>

    <x:parse var=”doc”>
    <person>
    <firstname>Sue</firstname>
    <lastname>Tillman</lastname>
    </person>
    </x:parse>
    Hello <x:out select=”$doc/person/firstname” />

    </body>
    </html>

    ***********************************

    However, when I run it, I get the following error. I don’t get it. I have read several books and according to them, this example should work fine. Why does this not work and how do I fix it?

    type Exception report

    message

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

    exception

    javax.servlet.ServletException: org/apache/xpath/XPathException
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:848)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
    org.apache.jsp.portfolio_jsp._jspService(org.apache.jsp.portfolio_jsp:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    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

    java.lang.NoClassDefFoundError: org/apache/xpath/XPathException
    java.lang.ClassLoader.defineClass1(Native Method)
    java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1650)
    org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:856)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1305)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
    java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:63)
    org.apache.jsp.portfolio_jsp._jspx_meth_x_out_0(org.apache.jsp.portfolio_jsp:150)
    org.apache.jsp.portfolio_jsp._jspService(org.apache.jsp.portfolio_jsp:85)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    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)

    #249444 Reply

    awebpro
    Member

    PS> Doing a little search on the net found someone who claims the same problem and downloading Xalan fixed all his woes. If Xalan is required, wouldn’t MyEclipse have take care of it? And if I need to use it, how do I use it?

    #249509 Reply

    Haris Peco
    Member

    awebro,

    org.apache.xpath.XPathException is part of jdk from jdk >= 1.4.Lower version jdk (1.3) need xerces (it is in xerces libraries).Check your jdk version and application server, too.

    Best regards

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: JSTL XML tags do not work! Need help.

You must be logged in to post in the forum log in