cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Painter-Wakefield" <>
Subject Re: request taglib + query
Date Tue, 14 Aug 2001 15:33:16 GMT

Anne Marie,

this may sound completely stupid, but remove the semicolon at the end of
your query.  I copied your XML into a new file in my project and edited it
to make the query match tables in my database and changed the pool to one
of my own pools.  I also removed your stylesheets and used a simple source
formatter stylesheet.  I made no other changes.  When I ran the query with
an appropriate parameter, I got no results.  When I edited the file to
remove the semicolon, I got results.  Just to make sure, I added the
semicolon back in, and sure enough, I got no results again.  Perhaps this
is some JDBC thing.  I do know that all of the working examples I have
seen, and all of the queries in my own code, are not terminated in any way.


Please respond to


Subject:  request taglib + query

Hi all,

and thanks for helping me so much!

Unfortunately, I still cannot get my page to do what I want:

*I am able to pick up the http request parameter from the URL and display
*I am able to run the query if I hardcode the value
*But I am not able to run the query with the value that I pick up from the

I have also included the xml file and the generated java code. It looks
to me. You can see that I have put a request in the xml document just to
display, and this displays OK on the screen. But for some reason it won't
work in the query... The java code generated in each case is the same,

*I have tried with ?userID=55512345
*I have tried to have the database field as a string and as an integer
*Using xsp-request instead of request doesn't work (I think maybe that's
*I have tried EVERY other suggestion that I have received, but with no luck

I guess the reason must be that the query is attempted run BEFORE the
parameter is found. Does anybody have any idea how I can work around this
use the parameter in the query?

I would also like to try to store the parameter in a variable, and then try
and use the variable in the query to see if that works. Does anybody now
I can do that? Christopher and Max, you both had an idea of building the
query as a string with xsp:logic, but I am not able to do it right! If I
to use request.GetParameter I get error messages...

Thanks again!

Anne Marie


<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="welcome-html.xsl" type="text/xsl"?>
<?xml-stylesheet href="welcome-wml.xsl" type="text/xsl" media="wap"?>

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

<!-- Welcome.xml -->
<!-- Written by Anne Marie Hartvigsen -->

<!DOCTYPE document [
  <!ENTITY email "">

<xsp:page language="java"

    <pagetitle title="Titleinfo"/>

      <request:get-parameter name="userID"/>

      Below the query results should be displayed.




      select name as reg_name,
             deviceID as reg_deviceID,
             description as reg_description,
             startTime as reg_startTime,
             endTime as reg_endTime
      from user, terminal, deviceType, registration
      where terminal.userID = <request:get-parameter name="userID"/>
            and user.userID = terminal.userID
            and deviceType.deviceType = terminal.deviceType
            and registration.terminalID = terminal.terminalID;
        These are your registrations,
          <esql:get-string column="reg_name"/>
            <esql:get-string column="reg_deviceID"/>
            <esql:get-string column="reg_description"/>
            <esql:get-string column="reg_startTime"/>
            <esql:get-string column="reg_endTime"/>



      Made by: &email;

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