cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Potkanski" <>
Subject Moving XSP from XML to a stylesheet, request now gives error.
Date Fri, 23 Mar 2001 05:00:04 GMT

Cocoon 1.8.2 on Tomcat 2.2 on Linux (latest production releases).

This fragment of code is part of a larger code that worked under .xml, but
when I put it into a style sheet, I get this error:

java.lang.Exception: XSP Java Compiler: Compilation failed for
28: Undefined variable or class name: request
    static String filename = normalize(request.getRequestURI());

Here's a code fragment of what I'm trying to do.

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"

  <xsl:template match="/">
   <xsl:processing-instruction name="xml-stylesheet">href="news-html.xsl"

   <xsp:page language="java" xmlns:xsp=""



    private String normalize(String string) { if (string == null) return "";
else return string; }
    static String filename = normalize(request.getRequestURI());
    /*String pathname = normalize(XSPUtil.pathComponent(
                            XSPUtil.fileComponent(filename), request,
(ServletContext) context)
    String pathname = "/var/tomcat/webapps/cocoon/courier/";
    final File path = new File(pathname);
    final String[] theList = path.list( new FilenameFilter() {
        public boolean accept (File dir, String n) {
         if (n.endsWith(".xml")) return true;
         else return false; }});
    static String metaContent = "news";


-Jason Potkanski

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message