cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tiberiu DONDERA" <tibidond...@hotmail.com>
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:

  <esql:execute-query>
      ....
    <esql:results>
      <esql:row-results>
        <xsp:logic>String username = <esql:get-string
column="name"/>;</xsp:logic>
      </esql:row-results>
    </esql:results>
  </esql:execute-query>

      <username>
        <xsp:expr>username</xsp:expr>
      </username>

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

 at
org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJa
vaProcessor.java:141)
 at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:489)
 at org.apache.cocoon.Engine.handle(Engine.java:359)
 at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
 at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:156)
 at
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338
)
 at java.lang.Thread.run(Thread.java:484)
-----------

  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
necessary?

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 <balld@webslingerZ.com>
To: <cocoon-users@xml.apache.org>; Tiberiu DONDERA <tibidondera@yahoo.com>
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
I
> > 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: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>

Mime
View raw message