cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Engelhart <mengelh...@earthtrip.com>
Subject Re: Beginer XSP question
Date Mon, 13 Mar 2000 16:18:49 GMT
guiferpo@teleco.upv.es wrote:

> 
> I have the following XSP page:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <?cocoon-process type="xsp"?>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet  href="frames2.xsl" type="text/xsl"?>
> 
> 
> <xsp:page language="java"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> 
> <xsp:logic>
> 
> HttpSession session=request.getSession(true);
> String done=(String)session.getValue("file");
> 
> </xsp:logic>
> <session><xsp:expr>done</xsp:expr></session>
> 
> 
> </xsp:page>
> 
> 
> When i call the page i get this error.
> java.lang.Exception: XSP Java Compiler: Compilation failed for
> _frames.java
> 25: Undefined variable or class name: request
> HttpSession session=request.getSession(true);
<xsp:logic> elements that appear outside of the root XSP node (your example
doesn't have an xsp root node) are class variables outside the scope of the
request and session objects.  You need to do something like this:

<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
       
    <document>
       <xsp:logic>
          
           HttpSession session=request.getSession(true);
           String done=(String)session.getValue("file");
             
        </xsp:logic>
        <session><xsp:expr>done</xsp:expr></session>
    </document >
  
</xsp:page>


This will work. 

Mike


Mime
View raw message