cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject Re: Java strings vs. Javascript strings
Date Mon, 27 Aug 2007 12:50:13 GMT
Tobia Conforto wrote:
> Hello
> 
> Am I the only Cocoon user who is extremely annoyed by the fact that Java
> strings are not Javascript strings are not Java strings?
> 
...
> 
> Can't Rhino, or whatever piece of software is bridging Javascript to Java,
> do the Right Thing and present every string as a Javascript string when
> I'm programming in Javascript?  Can it be configured to do so?

According to the Rhino documentation[1]:

"
Rhino also makes the JavaScript methods available to Java strings if the 
java.lang.String class doesn't already define them. For example:

    js> javaString.match(/a.*/)
    ava
"

Does that shortcut behavior work for you?  If so, you could just stick 
to the JS String methods regardless of the type; does that solve your 
headaches?

--Jason

[1] http://www.mozilla.org/rhino/ScriptingJava.html

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


Mime
View raw message