cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Cordes <>
Subject Dynamic sql Query
Date Tue, 29 Aug 2000 21:38:53 GMT
Hello all.  

I'm having a bit of trouble understanding how xsp and java interact.
I have a sql query that i wish to augment based upon request parameters.
Here is an example:

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="page.xsl" type="text/xsl"?>

	xmlns:sql="I can't recall the sql namespace, but its correct in my code"

	String name = String.valueOf( <request:get-parameter name="name"/> );
	String age = String.valueOf( <request:get-parameter name="age"/> );
	String where = "";

	if ( name != null &amp;&amp; !name.equals(""))
		where = " name is not null";

	else if ( age != null &amp;&amp; !name.equals(""))
		where = " age is not null";

	<!-- i left out the driver, etc for brevity -->
			select name, age, occupation, etc from sometable
			where <xsp:expr>where</xsp:expr>


This is an oversimplified example, but you see what I'm trying to do.
I want to construct a java string and then pass it to the sqltaglib.

The problem is I'm told 'request' is undefined upon compilation
of the xsp:logic block above. The 'where' is also undefined in the 
sql:execute-query block.

Any ideas? 


View raw message