Ragic ガイド
IT化のプロフェッショナルであるRagicと共にデータベースを活用して
チームを更に成長させましょう。
RagicをフォローしてIT化の波に加わりましょう。
Trending
Applications
Case Studies
What is Ragic
Talking Ragic
Facebook Twitter YouTube
クラウドデータベース
ガイド
Ragicについて
Trending
Applications
Case Studies
What is Ragic
Talking Ragic

Javascript data types vs. Java data types

作成者:Jeff Kuo

One of the most common problem Ragic developers encounter is the difference between Javascript data types and Java data types in workflow programs. Our workflow engine runs on Rhino java scripting engine, and here's some advice from Mozilla that may help developers:

https://developer.mozilla.org/en-US/docs/Scripting_Java

The difference between Java Strings and Javascript Strings is actually the most common problem:

Java Strings and JavaScript Strings

It's important to keep in mind that Java strings and JavaScript strings are not the same. Java strings are instances of the type java.lang.String and have all the methods defined by that class. JavaScript strings have methods defined by String.prototype. The most common stumbling block is length, which is a method of Java strings and a dynamic property of JavaScript strings:

js> javaString = new java.lang.String("Java")

Java

js> jsString = "JavaScript"

JavaScript

js> javaString.length()

4

js> jsString.length

10

Rhino provides some help in reducing the differences between the two types. First, you can pass a JavaScript string to a Java method that requires a Java string and Rhino will perform the conversion. We actually saw this feature in action on the call to the java.lang.String constructor in the preceding example.

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

Powered By Ragic! : 最強の企業デジタル化ノーコードツール
データをエクセルで扱っていると、チームの作業効率が下がってしまい、ミスが増え、管理が難しくなってしまいます。
チームが成長するほど、エクセルでのデータ管理は大変になっていきます。
そこで、クラウドデータベースを作成しましょう。

無料でRagicを始める

Googleアカウントに登録