资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

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://cdkjz.cn/article/dshoodh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220