Discussions

Web tier: servlets, JSP, Web frameworks: Setting paths in Tomcat for Xalan\Xerces

  1. Setting paths in Tomcat for Xalan\Xerces (3 messages)

    Hi
     Can anybody know how to set the paths in Tomcat for Xalan and SAX. I am using Tomcat 4 and the using jsp to do the transformation using XSLT. I get the following error when I run the JSP page.

    org.apache.jasper.JasperException: Unable to compile class for JSPC:\Tomcat\work\localhost\DigitalFactory\_0002fjsp_0002fdotranform_0002ejspdotranform_jsp_0.java:78: Class jsp.XSLTProcesser not found.
                                 XSLTProcesser processor = XSLTProcessorFactory.getProcessor();
                                 ^
    1 error

    My code is like this...

    <%@ page import="java.io.*, org.apache.xalan.xslt.*,org.apache.xerces.parsers.*,org.xml.sax.*" %>
     
      <%
     
      String xmlpath = application.getRealPath("jsp/Employees.xml");
    FileReader xmlreader = new FileReader(xmlpath);
            
                    XSLTInputSource xmlsource = new XSLTInputSource(xmlreader);
            
                 String xslpath = application.getRealPath("jsp/Employees.xsl");
                 FileReader xslreader = new FileReader(xslpath);
            
                 XSLTInputSource xslsource = new XSLTInputSource(xslreader);
                
                 PrintWriter outwriter = response.getWriter();
                 XSLTResultTarget target = new XSLTResultTarget(outwriter);
                
                 XSLTProcesser processor = XSLTProcessorFactory.getProcessor();
                 processor.process(xmlsource, xslsource, target);
                
               %>

    Th XML and XSL files are generated on the fly by Java Beans after getting data from database.
    I will appreciate your help
    ThankYou
    Asad
  2. Panic over
      The paths should be set in Catalina.bat file and the xalan.jar and xerces.jar should be in Tomcat\Bin

    Asad
  3. didn't you mean they should be installed in the tomcat\lib directory instead of the tomcat\bin ???
  4. Panic over
      The paths should be set in Catalina.bat file and the xalan.jar and xerces.jar should be in Tomcat\Bin

    Asad