You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alex Keledjian <a....@lespetitsdebrouillards.org> on 2003/06/20 00:51:42 UTC

trouble with xsp on cocoon

  Hello,
I have some little trouble with this XSP script :
The aims of this one is to get some POST variables, to build a query, 
compute it and show the result with XSLT stylesheet.
I use cocoon 2.0.4
j2sdk1.4.1_02

But cocoon says that to me :

org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Error compiling 
comp_rech_xsp:
Line 272, column 8:  illegal start of type
Line 377, column 58:  method valueOf() not found in class java.lang.String
Line 0, column 0: 2 errors

The script :
<?xml version="1.0" encoding="iso-8859-1"?>
<xsp:page language="java"    xmlns:xsp=""http://apache.org/xsp"    
xmlns:esql="http://apache.org/cocoon/SQL/v2"
  xmlns:xsl="http://www.w3c.org/1999/XSL/Transform">
<xsp:structure>
  <xsp:include>java.net.*</xsp:include>
  <xsp:include>java.util.*</xsp:include>
  <xsp:include>javax.servlet.*</xsp:include>
  <xsp:include>javax.servlet.http.*</xsp:include>
</xsp:structure>
  <xsp:logic>
   String type_exp=request.getParameter("type");
   String[] val=request.getParameterValues("select_item[]");
   String chaine="";
   int longueur=val.length;
      // construction de la chaine des conditions requises
      for (int i=0;i&lt;longueur;i++) {
       chaine=chaine+"[livre_tbl.id_livre=meta_"+type_exp+"_tbl.id_livre"+
       " AND meta_"+type_exp+"_tbl.id_"+type_exp+"=\""+val[i]+"\"]";
       if (i&lt;(longueur-1)) {
       chaine=chaine+" OR ";
       }
   };
      // construction de la requete
      String requete="SELECT livre_tbl.id_livre livre_tbl.titre FROM 
livre_tbl, "+
   "meta_"+type_exp+"_tbl WHERE ("+chaine+")";
     </xsp:logic>
  <resultat>
   <esql:connection>
       <esql:pool>polluser</esql:pool>
       <esql:execute-query>
       <req>
       <esql:query>
           <xsp:expr>requete</xsp:expr>
       </esql:query>
       <esql:results>
           <esql:row-results>
           <item>
               <xsp:attribute name="id">
               <esql:get-int column="id_livre"/>
               </xsp:attribute>
               <esql:get-string column="titre"/>
           </item>
           </esql:row-results>
       </esql:results>
       </req>
       </esql:execute-query>
   </esql:connection>
  </resultat>
</xsp:page>

Does someone could help me ?

Alex
(sorry for my poor english ; )


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org