我正在尝试使用 java 小程序创建一个 excel 文件并保存到本地文件系统。签署应用程序后,我可以通过直接调用小程序成功创建文件。但是,当我尝试从 javascript 调用该方法时,它失败且没有任何错误消息。我想知道是否有任何策略控制来防止从 javascript 调用 java 方法?
<html>
<script language="JavaScript">
function createExcel()
{
document.excel.createExcel();
document.excel.setMessage("hello world from js");
}
</script>
<body>
<input type="button" value="Generate Excel" onclick="createExcel()" />
<applet id='applet' name='excel' archive='Office.jar,poi-3.7-20101029.jar' code='com.broadridge.Office.class' width='100' height='100'></applet>
</body>
</html>