cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan" <>
Subject Passing parameters to an xml file to get a select from a DB
Date Fri, 02 Feb 2001 16:46:13 GMT
I'm sorry to make this question, because it could be out of topic, but i'm getting crazy ...
I was reading some info on this in ,
but it's not exactly the same ...

My file is:

<?xml version="1.0" encoding="iso-8859-1"?>
<?cocoon-process type="xsp"?>
<?cocoon-format type="text/xml"?>
<?xml-logicsheet href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
<xsp:page language="java" xmlns:esql="" xmlns:xsp="">
String country1 = request.getParameter("country1");
String country2 = request.getParameter("country2");
<esql:query>select * from countries where name&gt;='<xsp:expr>country1</xsp:expr>'
and name&lt;='<xsp:expr>country2</xsp:expr>'</esql:query>
<esql:get-string column="name"/>
<esql:get-string column="letters"/>

passing the parameters to the file this way : countries.xml?country1=A&country2=C
(ie) to acquire the list of countries from my DB between A and B (included)

The error message goes like this:  

Error found handling the request.

java.lang.Exception: XSP Java Compiler: Compilation failed for
102: Undefined variable: country1 + country1         
105: Undefined variable: country2 + country2);         
2 errors

at org.apache.cocoon.processor.xsp.XSPProcessor.process(  
at org.apache.cocoon.Engine.handle( 
at org.apache.cocoon.Cocoon.service( 
at javax.servlet.http.HttpServlet.service(  
at org.apache.tomcat.core.ServletWrapper.doService(  
at org.apache.tomcat.core.Handler.service( 
at org.apache.tomcat.core.ServletWrapper.service(  
at org.apache.tomcat.core.ContextManager.internalService(  
at org.apache.tomcat.core.ContextManager.service(  
at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(
at org.apache.tomcat.service.TcpWorkerThread.runIt(  
at org.apache.tomcat.util.ThreadPool$  

Any idea on this?¿


Iván Fontán
Technical Department


Spain Office
Trav. Gràcia, 342-344
08025 Barcelona (Spain)
Tel.: +34 934 465 026

US Offices
New York
885 3rd Avenue
Suite 2800
New York, NY 10022

1210 Brickell Avenue
Suite 430
Miami, FL 33131

View raw message