You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by sergi <sr...@gsmms1.com> on 2001/10/12 10:49:15 UTC

Problem with java code in XSP

hi,
if someone is able to help me i would be gratefull!
i put one line of java code in my XSP and everything was ok.
code looked like this:

			....................................
   <xsp:logic>
   	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
   	String strn1 = "select k.naziv from komitent k, ugovor u where u.msisdn
= '"+MSISDN+"' and k.id = u.komitent";
   </xsp:logic>
	   <esql:connection>
	     <esql:pool>romeo</esql:pool>
	     <esql:execute-query>
	       <esql:query><xsp:expr>strn</xsp:expr></esql:query>
			....................................

and results was ok!...



after that i added few new lines in java part of the code... like this:

			....................................
   <xsp:logic>
   	String requestName = <xsp-request:get-parameter name="requestName"
as="string"/>;
   	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
   	String AccountNumber = <xsp-request:get-parameter
name="AccountNumber"/>;
   	String strn = "";
   	String strn1 = "select k.naziv from komitent k, ugovor u where u.msisdn
= '"+MSISDN+"' and k.id = u.komitent";
   	String strn2 = "select * from racun where orgjed = '03' and broj
='"+AccountNumber+"'";
   	String strn3 = "select r.totaliznos from racun r, ugovor u where
u.msisdn = '"+MSISDN+"' and u.id = r.ugovor";
   	if(requestName != null)
   		if(requestName == "ReadAccountAndCustomer")
   			strn = strn1;
   		else if(requestName == "ReadProductsForAccount")
   			strn = strn2;
   		esle if(requestName == "ReadProductDetails")
   			strn = strn3;
   </xsp:logic>
			....................................

after that got this error message:

The download of the specified resource has failed.

is anyone there who could help me!!!!!


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Problem with java code in XSP

Posted by Jeremy Aston <je...@yahoo.co.uk>.
OK Sergi - there was me looking at the typo and missing the big whopper
right in front of me!

Jez

>  -----Original Message-----
> From: 	sergi [mailto:srdjan.popic@gsmms1.com] 
> Sent:	12 October 2001 10:19
> To:	cocoon-users@xml.apache.org; jez@pigbite.com
> Subject:	RE: Problem with java code in XSP
> 
> i solved problem!!! 
>  i compare strings with method compareTo
> 
> thx, anyway!!!
> 
> 	 -----Original Message-----
> 	From: 	Jeremy Aston [mailto:jeremyaston@yahoo.co.uk] 
> 	Sent:	Friday, October 12, 2001 11:09 AM
> 	To:	cocoon-users@xml.apache.org
> 	Subject:	RE: Problem with java code in XSP
> 
> 	Hi Sergi,
> 
> 	You may want to correct the typo...
> 
> 	   			strn = strn2;
> 	   		esle if(requestName == "ReadProductDetails")
> 	   			strn = strn3;
> 	   </xsp:logic>
> 
> 	to say
> 
> 	   			strn = strn2;
> 	   		else if(requestName == "ReadProductDetails")
> 	   			strn = strn3;
> 	   </xsp:logic>
> 
> 	(That's the esle to else if it's not clear).
> 
> 	Dunno if thats the whole problem but it will stop it from compiling
> and hence being delivered.
> 
> 	Regards
> 
> 	Jeremy
> 
> 	-----Original Message-----
> 	From: sergi [mailto:srdjan.popic@gsmms1.com]
> 	Sent: 12 October 2001 09:49
> 	To: cocoon-users@xml.apache.org
> 	Subject: Problem with java code in XSP
> 
> 
> 	hi,
> 	if someone is able to help me i would be gratefull!
> 	i put one line of java code in my XSP and everything was ok.
> 	code looked like this:
> 
> 				....................................
> 	   <xsp:logic>
> 	   	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
> 	   	String strn1 = "select k.naziv from komitent k, ugovor u
> where u.msisdn
> 	= '"+MSISDN+"' and k.id = u.komitent";
> 	   </xsp:logic>
> 		   <esql:connection>
> 		     <esql:pool>romeo</esql:pool>
> 		     <esql:execute-query>
> 		       <esql:query><xsp:expr>strn</xsp:expr></esql:query>
> 				....................................
> 
> 	and results was ok!...
> 
> 
> 
> 	after that i added few new lines in java part of the code... like
> this:
> 
> 				....................................
> 	   <xsp:logic>
> 	   	String requestName = <xsp-request:get-parameter
> name="requestName"
> 	as="string"/>;
> 	   	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
> 	   	String AccountNumber = <xsp-request:get-parameter
> 	name="AccountNumber"/>;
> 	   	String strn = "";
> 	   	String strn1 = "select k.naziv from komitent k, ugovor u
> where u.msisdn
> 	= '"+MSISDN+"' and k.id = u.komitent";
> 	   	String strn2 = "select * from racun where orgjed = '03' and
> broj
> 	='"+AccountNumber+"'";
> 	   	String strn3 = "select r.totaliznos from racun r, ugovor u
> where
> 	u.msisdn = '"+MSISDN+"' and u.id = r.ugovor";
> 	   	if(requestName != null)
> 	   		if(requestName == "ReadAccountAndCustomer")
> 	   			strn = strn1;
> 	   		else if(requestName == "ReadProductsForAccount")
> 	   			strn = strn2;
> 	   		esle if(requestName == "ReadProductDetails")
> 	   			strn = strn3;
> 	   </xsp:logic>
> 				....................................
> 
> 	after that got this error message:
> 
> 	The download of the specified resource has failed.
> 
> 	is anyone there who could help me!!!!!
> 
> 
> 	
> ---------------------------------------------------------------------
> 	Please check that your question has not already been answered in the
> 	FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> 	To unsubscribe, e-mail: <co...@xml.apache.org>
> 	For additional commands, e-mail: <co...@xml.apache.org>
> << File: ATT00011.txt >>  << File: ATT00047.txt >> 

RE: Problem with java code in XSP

Posted by sergi <sr...@gsmms1.com>.
i solved problem!!! 
 i compare strings with method compareTo

thx, anyway!!!

>  -----Original Message-----
> From: 	Jeremy Aston [mailto:jeremyaston@yahoo.co.uk] 
> Sent:	Friday, October 12, 2001 11:09 AM
> To:	cocoon-users@xml.apache.org
> Subject:	RE: Problem with java code in XSP
> 
> Hi Sergi,
> 
> You may want to correct the typo...
> 
>    			strn = strn2;
>    		esle if(requestName == "ReadProductDetails")
>    			strn = strn3;
>    </xsp:logic>
> 
> to say
> 
>    			strn = strn2;
>    		else if(requestName == "ReadProductDetails")
>    			strn = strn3;
>    </xsp:logic>
> 
> (That's the esle to else if it's not clear).
> 
> Dunno if thats the whole problem but it will stop it from compiling and
> hence being delivered.
> 
> Regards
> 
> Jeremy
> 
> -----Original Message-----
> From: sergi [mailto:srdjan.popic@gsmms1.com]
> Sent: 12 October 2001 09:49
> To: cocoon-users@xml.apache.org
> Subject: Problem with java code in XSP
> 
> 
> hi,
> if someone is able to help me i would be gratefull!
> i put one line of java code in my XSP and everything was ok.
> code looked like this:
> 
> 			....................................
>    <xsp:logic>
>    	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
>    	String strn1 = "select k.naziv from komitent k, ugovor u where
> u.msisdn
> = '"+MSISDN+"' and k.id = u.komitent";
>    </xsp:logic>
> 	   <esql:connection>
> 	     <esql:pool>romeo</esql:pool>
> 	     <esql:execute-query>
> 	       <esql:query><xsp:expr>strn</xsp:expr></esql:query>
> 			....................................
> 
> and results was ok!...
> 
> 
> 
> after that i added few new lines in java part of the code... like this:
> 
> 			....................................
>    <xsp:logic>
>    	String requestName = <xsp-request:get-parameter name="requestName"
> as="string"/>;
>    	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
>    	String AccountNumber = <xsp-request:get-parameter
> name="AccountNumber"/>;
>    	String strn = "";
>    	String strn1 = "select k.naziv from komitent k, ugovor u where
> u.msisdn
> = '"+MSISDN+"' and k.id = u.komitent";
>    	String strn2 = "select * from racun where orgjed = '03' and broj
> ='"+AccountNumber+"'";
>    	String strn3 = "select r.totaliznos from racun r, ugovor u where
> u.msisdn = '"+MSISDN+"' and u.id = r.ugovor";
>    	if(requestName != null)
>    		if(requestName == "ReadAccountAndCustomer")
>    			strn = strn1;
>    		else if(requestName == "ReadProductsForAccount")
>    			strn = strn2;
>    		esle if(requestName == "ReadProductDetails")
>    			strn = strn3;
>    </xsp:logic>
> 			....................................
> 
> after that got this error message:
> 
> The download of the specified resource has failed.
> 
> is anyone there who could help me!!!!!
> 
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org> <<
> File: ATT00011.txt >> 

RE: Problem with java code in XSP

Posted by Jeremy Aston <je...@yahoo.co.uk>.
Hi Sergi,

You may want to correct the typo...

   			strn = strn2;
   		esle if(requestName == "ReadProductDetails")
   			strn = strn3;
   </xsp:logic>

to say

   			strn = strn2;
   		else if(requestName == "ReadProductDetails")
   			strn = strn3;
   </xsp:logic>

(That's the esle to else if it's not clear).

Dunno if thats the whole problem but it will stop it from compiling and
hence being delivered.

Regards

Jeremy

-----Original Message-----
From: sergi [mailto:srdjan.popic@gsmms1.com]
Sent: 12 October 2001 09:49
To: cocoon-users@xml.apache.org
Subject: Problem with java code in XSP


hi,
if someone is able to help me i would be gratefull!
i put one line of java code in my XSP and everything was ok.
code looked like this:

			....................................
   <xsp:logic>
   	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
   	String strn1 = "select k.naziv from komitent k, ugovor u where
u.msisdn
= '"+MSISDN+"' and k.id = u.komitent";
   </xsp:logic>
	   <esql:connection>
	     <esql:pool>romeo</esql:pool>
	     <esql:execute-query>
	       <esql:query><xsp:expr>strn</xsp:expr></esql:query>
			....................................

and results was ok!...



after that i added few new lines in java part of the code... like this:

			....................................
   <xsp:logic>
   	String requestName = <xsp-request:get-parameter name="requestName"
as="string"/>;
   	String MSISDN = <xsp-request:get-parameter name="MSISDN"/>;
   	String AccountNumber = <xsp-request:get-parameter
name="AccountNumber"/>;
   	String strn = "";
   	String strn1 = "select k.naziv from komitent k, ugovor u where
u.msisdn
= '"+MSISDN+"' and k.id = u.komitent";
   	String strn2 = "select * from racun where orgjed = '03' and broj
='"+AccountNumber+"'";
   	String strn3 = "select r.totaliznos from racun r, ugovor u where
u.msisdn = '"+MSISDN+"' and u.id = r.ugovor";
   	if(requestName != null)
   		if(requestName == "ReadAccountAndCustomer")
   			strn = strn1;
   		else if(requestName == "ReadProductsForAccount")
   			strn = strn2;
   		esle if(requestName == "ReadProductDetails")
   			strn = strn3;
   </xsp:logic>
			....................................

after that got this error message:

The download of the specified resource has failed.

is anyone there who could help me!!!!!


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>