cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai.Reh...@pass-consulting.com
Subject AW: XSP:LOGIC
Date Thu, 26 Oct 2000 07:02:17 GMT
Hi Robin,

thank you for helping me. I made the suggested changes but get an error.

Error found handling the request.
java.lang.Exception: XSP Java Compiler: Compilation failed for _Upload2.java
230: Undefined variable: K

          xspExpr(K, document)

                  ^
1 error

Do you have any suggestions?

Thanks Kai

-----Urspr√ľngliche Nachricht-----
Von: Robin Green [mailto:greenrd@hotmail.com]
Gesendet am: Mittwoch, 25. Oktober 2000 16:58
An: cocoon-users@xml.apache.org
Betreff: Re: XSP:LOGIC

Kai.Rehlen@pass-consulting.com wrote:
>I pass the variable "K" to this page. "K" looks like "XXX,YYY" .
>The question now is how to retrieve "K" in my <xsp:logic> so that it can be
>processed and returned to the query below.

Ok, see changes below.

>
>
><?xml version="1.0" encoding="UTF-8"?>
><?cocoon-process type="xsp"?>
><?cocoon-process type="sql"?>
><?cocoon-process type="xslt"?>
><?xml-stylesheet href="./Upload2.xsl" type="text/xsl"?>
>
><xsp:page language="java"
>	xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> >
><xsp:logic>
>private int i = 0;
>
>public String Pars() {

Declare the parameter here.

public String pars(String K) {

>
>while (K.charAt(i) != ',') i++;

instead you could just put

i = K.indexOf (',');

>K=K.substring(0,i);
>System.out.println(K);
>return K;
>}
></xsp:logic>
>
><page>

String K = request.getParameter ("K");
K = pars(K);

>	<connectiondefs>
>		<connection name="FuE">
>			<driver>COM.ibm.db2.jdbc.app.DB2Driver</driver>
>			<dburl>jdbc:db2:FuE</dburl>
>			<username>***</username>
>			<password>***</password>
>		</connection>
>	</connectiondefs>
>	<query connection="FuE">select c.catid, c.name, cat.cat_catid,
>cat.catid
>						from category as c, cat_cat
>as cat
>						where cat.catid = {@K} and

instead

where cat.catid = <xsp:expr>K</xsp:expr>

>c.catid = cat.cat_catid
>	</query>
></page>
>
></xsp:page>


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


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

Mime
View raw message