2010年3月3日星期三

gwt中JavaScript访问java代码

javascript 调用java代码
//调用JAVA静态方法
//规则: @全路径类名::静态方法名(方法签名)(传入参数)
//@com.capinfo.cdss.gwt.olap.client.ui.PartOlapCenterTab::saveOlapState

(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava

/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)

(saveName,dims,rowDims,colDims,sql,colLabels,expandInfo,hideInfo,exp,field,remark);
//调用JAVA非静态方法
//规则:实例对象.@全路径类名::方法名(方法签名)(传入参数)
//this.@com.capinfo.cdss.gwt.olap.client.ui.PartOlapCenterTab::saveOlapState

(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava

/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)

(saveName,dims,rowDims,colDims,sql,colLabels,expandInfo,hideInfo,exp,field,remark);


//调用JAVA的非静态属性
//规则:实例对象.@全路径类名::属性名
//var field=this.@com.capinfo.cdss.gwt.olap.client.ui.PartOlapCenterTab::field;

参考:http://java.sun.com/j2se/1.4.2/docs/guide/jni/spec/types.html#wp16432
http://yonglin4605.javaeye.com/blog/568045
http://yonglin4605.javaeye.com/blog/564829

没有评论:

发表评论