Hi, i notice that i get an error if i put <xsp:expr> between tags <esql:results>,
 
it seems a strange thing...there's a particular tag or method to process a result after a query?
 
or that's a bug?
 
 
Error:
 
org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling query_prod_xsp:
Line 962, column 49:  illegal start of expression
Line 0, column 0:
1 error
 
Code:
 

<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- CVS: $Id: esql.xsp,v 1.4 2002/02/09 06:21:57 vgritsenko Exp $ -->

<xsp:page language="java"

xmlns:xsp="http://apache.org/xsp"

xmlns:esql="http://apache.org/cocoon/SQL/v2"

xmlns:xsp-request="http://apache.org/xsp/request/2.0"

>

<xsp:logic>

String pippo="eheh";

String pippo2="";

String pippo3="";

static String replace(String str, String pattern, String replace) {

int s = 0;

int e = 0;

StringBuffer result = new StringBuffer();

while ((e = str.indexOf(pattern, s)) >= 0) {

result.append(str.substring(s, e));

result.append(replace);

s = e+pattern.length();

}

result.append(str.substring(s));

return result.toString();

}

 

</xsp:logic>

<page>

 

 

<esql:connection>

<esql:pool>trafomec</esql:pool>

 

<esql:execute-query>

<esql:query>select distinct nome_prod, data_prod from tabella_prodotto where id_prod=<xsp:expr>request.getParameter("num")</xsp:expr>

</esql:query>

<esql:results>

<esql:row-results>

<nomeprod><esql:get-string column="nome_prod"/></nomeprod>

<dataprod><esql:get-string column="data_prod"/></dataprod>

</esql:row-results>

</esql:results>

</esql:execute-query>

 

 

<!-- Query per la Foto -->

<tabellafoto>

<esql:execute-query>

<esql:query>select distinct id_ufoto,link,desc_foto from tabella_foto where id_foto=<xsp:expr>request.getParameter("num")</xsp:expr>

</esql:query>

<esql:results>

<esql:row-results>

<foto>

<linkfoto><esql:get-string column="link"/></linkfoto>

<descfoto><esql:get-string column="desc_foto"/></descfoto>

</foto>

</esql:row-results>

</esql:results>

</esql:execute-query>

</tabellafoto>

<catfun>

<esql:execute-query>

<esql:query>select distinct tabella_at.nome_at as nome_at, tabella_cf.nome_cf as nome_cf from tabella_at,tabella_cf,tabella_famiglia,tabella_prodotto where tabella_famiglia.id_at=tabella_at.id_at and tabella_famiglia.id_cf=tabella_cf.id_cf and tabella_famiglia.id_fa=4 and tabella_prodotto.id_fa=4</esql:query>

<esql:results>

<esql:row-results>

<bl_cf>

<cat><esql:get-string column="nome_at"/></cat>

<fnc><esql:get-string column="nome_cf"/></fnc>

</bl_cf>

</esql:row-results>

</esql:results>

</esql:execute-query>

</catfun>

 

<spec>

<esql:execute-query>

<esql:query>select distinct specifiche from tabella_prodotto where id_prod=4</esql:query>

<esql:results>

<esql:row-results>

<esql:get-string column="specifiche"/>

<xsp:expr> </xsp:expr>

</esql:row-results>

</esql:results>

</esql:execute-query>

</spec>

</esql:connection>

</page>

</xsp:page>

Reply via email to