efwGrp/efw3.X

JAVA RETURN PROBLEM

WinterCool2968 opened this issue · 1 comments

excuse me,i found the same problem like i asked several days ago.
when i excute a method in java and want to get the return value,then the problem occured again.
is this a bug?

実行時エラーが発生しました。
eventId=sample_save
message=InternalError: Java class "[B" has no public instance field or method named "toJSON". (#173)

here are the details:

js File:
var sample_save={};
sample_save.name="保存文件";
sample_save.paramsFormat={
"#nom":"required:true;display-name:用户名",
};
sample_save.fire=function(params){
var nom=params["#nom"];
var rsPwd= (db.select("download_detailInfo","download",{"nom":nom}))
.map({"INFO":"BOOKID"}).getArray();
var XXX = Packages.create.PoiCommon.CreateHtml(nom, "D:\Tomcat 7.0\webapps\efw-3.0-oracl\WEB-INF\efw\storage");
return (new Result()).alert(XXX); // error
return (new Result()).alert(123); // correct

};

java File:

package create;
public class PoiCommon {
public static String CreateHtml(String pname,String purl){
System.out.println(pname);
System.out.println(purl);
return purl;
}
}

It is different about String in java and javascript.
You retur use java.string in javascript , so it is error. In this case, you should just do like ""+java.string.
return (new Result()).alert(""+XXX);