cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From george georgovassilis <geor...@open.gr>
Subject Re: Java methods..
Date Wed, 22 Dec 2004 13:07:56 GMT
Hi Roberto

This line really assings a java.lang.String object to 'pippo'
var pippo = new String();

And this line:
pippo = "PROVA";
breaks the assingment again, because "PROVA" is a JavaScript String 
(which is not a java.lang.String object for which the following holds:
var a = "PROVA";
var b = new java.lang.String("PROVA");
where a!=b
but a.equals(b)

I think pippo.length does the job for JavaScript strings or, you just 
have to do
var pippo = new String("PROVA");
G.

Roberto wrote:

> Hi there,
> I got a little problem I don't get what's wrong in my flowscript... 
>  
> importClass(Packages.java.lang.String);
> ....
>  
> function prova(){
>  
>   var pippo = new String();
>   pippo = "PROVA";
>  
>   java.lang.System.out.println("NUMERO:"+pippo.lenght());
>
> }
>  
> But the system gave me back an error telling me that:
>  
>
>
>   An Error Occurred
>
> lenght is not a function.
>
> Why??
>
> Cheers, ROb
>
>  
>
>  
>



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


Mime
View raw message