接收JSONObject但无法读取JSONOject响应。它在正文中,在将帖子传递给servlet后无法访问。为什么选择iframe,因为在使用asynch时,我不知道以任何其他方式上传文件。请帮忙。我真的很困惑。
require(["dojo/request/iframe", "dojo/dom", "dojo/dom-form", "dojo/dom-construct",
"dojo/json", "dojo/on", "dojo/domReady!"],
function(iframe, dom, domForm, domConst, JSON, on){
on(dom.byId("startButton"), "click", function(){
iframe("addUser",{
form: "myForm",Ca
handleAs:"json",
}).then(function(response){
alert(response);
alert("data received!");
}, function(err){
alert("data denied!!!");
alert(err);
*********************** Servlet JSON响应************** ******************
JSONObject cert = new JSONObject();
cert.put("version", x509certificate.getVersion());
cert.put("valid from", x509certificate.getNotBefore());
cert.put("valid to", x509certificate.getNotAfter());
cert.put("issuer", x509certificate.getIssuerDN().getName());
cert.put("Thumbprint", getThumbPrint(x509certificate));
System.out.println(cert);
System.out.println(cert.toString());
out.print(cert.toString());