cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tiberiu DONDERA" <>
Subject Re: XSP and ESQL
Date Tue, 05 Dec 2000 13:33:07 GMT
Thank you for your help.
I have, however, strange errors when using this piece of code:

        <xsp:logic>String username = <esql:get-string


The error
java.lang.Exception: XSP Java Compiler: Compilation failed for
235: Undefined variable: username
          xspExpr(username, document)
1 error

 at org.apache.cocoon.Engine.handle(
 at org.apache.cocoon.Cocoon.service(
 at javax.servlet.http.HttpServlet.service(
 at org.apache.tomcat.core.ContextManager.service(

  IMHO (and I'm just making suppositions, because I don't have any knowledge
on the internals of Cocoon), this is because the class produced by the esql
is different from the class produced by xsp, so the code I produce with the
<xsp:logic> inside <esql:results> is not visible from the xsp produced
class, that produces my XML tree.
Is this a bug or is this the way that it should be? And if this is the way,
what is the proper way of solving this problem? (please note that the result
I have from the database may be used, after modifications in the java code,
in another sql query)

Also, the <esql:row-results> tag is getting copied in the result tree. Is
this normal?

You said something aboult upgrading my esql logicsheet from the cvs tree. I
am using Cocoon 1.8 (the 'out of the box' version). Is the upgrade really

Thank you,
Tibi Dondera

For Mr. Robin Green:
  I'm sorry, I didn't make myself well understood (difficult english :)
  The username was just an example (not very well chosen, as you have
pointed out, because I could have retrieved it from the html post). The
problem was that I wanted to be able to retrieve some information from the
database and to be able to use it later inside another <xsp:logic> tag.

----- Original Message -----
From: Donald Ball <>
To: <>; Tiberiu DONDERA <>
Sent: Monday, December 04, 2000 8:20 PM
Subject: Re: XSP and ESQL

> On Mon, 4 Dec 2000, Tiberiu DONDERA wrote:
> > I'm almost sure that this is a topic that has already been discused, but
> > could not find this piece of information anywhere :(
> experiment, young grasshopper. and update your esql logicsheet to the
> latest cvs version - you're using an old version of the namespace.
> > My question is: how can I use the value retrieved by the ESQL
afterwards, in
> > some XSP code?
> <esql:results>
>   <esql:row-results>
>     <xsp:logic>String name = <esql:get-string column="name"/>;</xsp:logic>
>   </esql:row-results>
> </esql:results>
> > username=???        // What should be here?
> > if (username.equals('anonymous')){
> >   <xsp:content>
> >      You are logged in as anonymous.
> >   </xsp:content>
> > }
> <esql:results>
>   <esql:row-results>
>     <xsp:logic>if ("anonymous".equals(<esql:get-string column="name"/>))
>       <xsp:content>You are logged in as anonymous.</xsp:content>
>     </xsp:logic>
>   </esql:row-results>
> </esql:results>
> - donald
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

View raw message