js可以调用java代码 js调用java代码数组

关于gwt里js调用java代码的问题

恩哼,javascript里面调用错了下面是摘自googleguan方的说明:

创新互联公司服务项目包括阳泉网站建设、阳泉网站制作、阳泉网页制作以及阳泉网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,阳泉网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到阳泉省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!

[instance-expr.]@class-name::method-name(param-signature)(arguments)

instance-expr.

:

must

be

present

when

calling

an

instance

method

and

must

be

absent

when

calling

a

static

method

class-name

:

is

the

fully-qualified

name

of

the

class

in

which

the

method

is

declared

(or

a

subclass

thereof)

param-signature

:

is

the

internal

Java

method

signature

as

specified

at

JNI

Type

Signatures

but

without

the

trailing

signature

of

the

method

return

type

since

it

is

not

needed

to

choose

the

overload

arguments

:

is

the

actual

argument

list

to

pass

to

the

called

method

大碰铅致是先要有这个类所在方法的实例,然后调用格式笑高好是

实例@类名::方法名(java类型的JNI类型)(参数)

其中,获得实例,也需要用到JNI,调用构造方法,java类型的JNI类型在oracleguan网上有对应,多参数之间用逗号隔开

举例

com.test.Test.class下有一个java方法

void

test(float

f,boolean

b,)...

调用格式是(假设instance已经取到)

instance@com.tets.Test::test(FZ)(1.2f,true)

其中instance假设已经通过JNI调用构造方法获得,FZ对应的是float和念模boolean,(float的JNI对应类型是F,boolean的对应类型的Z)中间没有任何分隔符,后面两个是传的参数

js调用java很复杂,比java调用JS远要复杂的多

更多参考资料,可以去google

gwtguan网找

链接我不能发,发了就被吞贴


网站栏目:js可以调用java代码 js调用java代码数组
分享链接:http://scyanting.com/article/dshoodh.html