cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Potkanski" <JT-Potkans...@wiu.edu>
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 _sample.java
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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">

  <xsl:template match="/">
   <xsl:processing-instruction
name="cocoon-process">type="xsp"</xsl:processing-instruction>
   <xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>
   <xsl:processing-instruction name="xml-stylesheet">href="news-html.xsl"
type="text/xsl"</xsl:processing-instruction>


   <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core"

xmlns:request="http://www.apache.org/1999/XSP/Request">

   <xsp:structure>
    <xsp:include>java.net.*</xsp:include>
   </xsp:structure>

   <xsp:logic><![CDATA[
    private String normalize(String string) { if (string == null) return "";
else return string; }
    static String filename = normalize(request.getRequestURI());
    /*String pathname = normalize(XSPUtil.pathComponent(
                           XSPUtil.relativeFilename(
                            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";

(chop)

-Jason Potkanski
^


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message