“对象不支持此属性或方法”发生在 javascript 中,并停在为 Liferay Portal 处理来自 applet 的方法调用的行处
javascript片段:
<script type="text/javascript">
function processSigning(){
var applet = document.applets["SignApplet"];
var path_to_certificate = document.getElementById("certificate").value;
var pass = document.getElementById("password").value;
var filePath = document.getElementById("documentSign").value;
applet.filePath = document.getElementById("documentSign").value;
//at this line, call of method from applet, javascript stops, but applet has this method
//and it's public
applet.profileTestPKCS12(path_to_certificate, pass);
document.getElementById("file").value = applet.getDocumentString(filePath);
document.getElementById("sign").value = applet.getSignString();
document.getElementById("cert").value = applet.getCertificateString();
document.forms['mainForm'].submit();
// document.getElementById("mainForm").submit();
}
</script>
html 的小程序片段:
<APPLET name="SignApplet" mayscript code="SignApplet.class" archive="<%=renderResponse.encodeURL(renderRequest.getContextPath() + "/lib/SignApplet.jar")%>, <%=renderResponse.encodeURL(renderRequest.getContextPath() + "/lib/crypto.tsp.jar")%>, <%=renderResponse.encodeURL(renderRequest.getContextPath() + "/lib/crypto.gammaprov.jar")%>" height=500 width=500 style="display:none;">
<PARAM name="boxmessage" value="Please wait, while applet is loading">
</APPLET>