cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject Re: forEach confusion
Date Sun, 23 Jul 2006 01:40:51 GMT
Andrew wrote:
> Hi Jason,
> 
>     Does that really work?  
> 
> So the Paypal developers say!  
> http://www.pdncommunity.com/pdn/board/message?board.id=api&message.id=131#M131 
> <http://www.pdncommunity.com/pdn/board/message?board.id=api&message.id=131#M131>

Well, not to knock down their developers, but that post doesn't look 
like an authoritative sample of working code. ;-)  First of all it isn't 
even valid Java syntax.  It's also different than what you pasted in 
since theirs doesn't try to assign the ErrorType object to a String 
variable.  In short, it doesn't do what you want.

>     I assume by "the object value" you mean a String representation of it?
>     Try ${item.toString()} ?
> 
> I mean the actual value held in the object. Even with item.toString() I 
> am still getting:
> 
> com.paypal.soap.api.ErrorType@727c61b7
> 
> type returns. What I want is to access the contents within object which 
> is a descriptive string describing why a credit card check was rejected.

OK, so call a method of the ErrorType class that returns the descriptive 
string you want.  Perhaps .getShortMessage() or .getLongMessage()?  You 
just need to look at what the API provides.

The fact that it's telling you it's got an ErrorType object indicates 
the forEach looping is working correctly.

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


Mime
View raw message