You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ntic <nt...@lespetitsdebrouillards.org> on 2003/06/20 00:14:56 UTC
need help on cocoon and XSP
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<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<(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
Re: need help on cocoon and XSP
Posted by ntic <nt...@lespetitsdebrouillards.org>.
Yes i've seen it but i don't see the trouble with the first error (Ligne
272)
Thios is the code :
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<longueur;i++) {
---> ligne 272
chaine+="[livre_tbl.id_livre=meta_"+type_exp+"_tbl.id_livre"+
" AND meta_"+type_exp+"_tbl.id_"+type_exp+"='"+val[i]+"']";
if (i<(longueur-1)) {
chaine=chaine+" OR ";
}
};
and i think that the second error depends on the first...
i don't know why there is an illegal start of type on line 272...
If someone see...
thancks
Alex
leo leonid a écrit :
>
> Did you already look at the generated java source?
> ([work-dir]/cocoon-files/org/apache/www/[projek-dirs]/
> comp_rech_xsp.java)
> /leo
>
> On Freitag, Juni 20, 2003, at 12:14 Uhr, ntic wrote:
>
>> 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<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<(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
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org
Re: need help on cocoon and XSP
Posted by leo leonid <te...@leonid.de>.
Did you already look at the generated java source?
([work-dir]/cocoon-files/org/apache/www/[projek-dirs]/
comp_rech_xsp.java)
/leo
On Freitag, Juni 20, 2003, at 12:14 Uhr, ntic wrote:
> 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<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<(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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org