cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Spinetti" <m.spine...@pisa.iol.it>
Subject Problem with xsp e esql
Date Mon, 11 Dec 2000 13:53:42 GMT
Hi all,
I have a problem in a page I use in Xsp and Esql. I better explain to myself. In my  file
I take  the parameters inserted by the user, I ask a database and build a Xml file to which
then I apply a Sheet style. My file is:

..............
<page>
<Section title="prova">
<xsp:logic>
wmlUtility wmlUtil = new wmlUtility();
String dbCognome = "";
String dbNome = "";
String dbProv = "";
String prefisso = null;
String numero = null;
if (request.getParameterValues("prefisso") != null)
  prefisso = request.getParameterValues("prefisso")[0];
if (request.getParameterValues("numero") != null)
  numero = request.getParameterValues("numero")[0];
if ((prefisso.equals("") == true) || (numero.equals("") == true) || (prefisso==null) || (numero==null))
{
<Result>
<Error>Inserire sia il prefisso che il numero</Error>
</Result>
}
else
{ 
String query = makeQueryElenco(numero, prefisso);
<Result>
<esql:connection>
  <esql:pool>elenco</esql:pool>
  <esql:execute-query>
   <esql:query><xsp:expr>query</xsp:expr></esql:query>
   <esql:results>
    <!-- <header>Elenco IOL</header> -->
    <esql:row-results>
    <ResultItem>
    <ResultElement>
    <ResultName name="numero"/>
    <ResultValue><Text><xsp:expr>prefisso</xsp:expr>-<xsp:expr>numero</xsp:expr></Text></ResultValue>
    </ResultElement>
    dbCognome = <esql:get-string column="1"/>;
    dbNome = <esql:get-string column="2"/>;
    dbProv = <esql:get-string column="6"/>; 
    String provEstesa = (String) hashProv1.get(dbProv);
    if (provEstesa != null)
     dbProv = provEstesa;
    if ((dbNome != null) &amp;&amp; (dbNome.equals("") == false))
    {
     dbNome = wmlUtil.wmlNormalize(dbNome);
     dbCognome = wmlUtil.wmlNormalize(dbCognome);
     <ResultElement>
     <ResultName name="nome"/>

    * <ResultValue><Text><xsp:expr>dbNome</xsp:expr></Text></ResultValue>
     
    </ResultElement>
     
    }
    else
    {
     dbCognome = wmlUtil.wmlNormalize(dbCognome);
    }
    <ResultElement>
    <ResultName name="cognome"/>
    
* <ResultValue><Text><xsp:expr>dbCognome</xsp:expr></Text></ResultValue>
    
</ResultElement>
.....................

The problem is that when I execute the * line inside the tag Text I do not obtain not at all
while if instead of <xsp:expr>dbNome</xsp:expr> (or <xsp:expr>dbCognome</xsp:expr>
) I put the esql:instruction <esql:get-string column="2"/> I obtain the value inside
the Text tag.
Why?
Where is my error?
I could put the Esql instruction but I would like to know why it does not work.
Thanks 
Regards
Marco

    

Mime
View raw message