JasperReport报表打印的问题?

阅读更多
对于jasperreport里的webapp的例子,里面有调用jasperPrint的对象.这里可以用下面的方式也可以同样得到.

jasperPrint=(JasperPrint) request.getSession().getAttribute(BaseHttpServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE);


在这过程中我遇到这样的问题,就是applet的安全问题?
点击打印时报错,如下所示错误信息,

java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.awt.windows)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPackageAccess(Unknown Source)
	at sun.applet.AppletSecurity.checkPackageAccess(Unknown Source)
	at java.lang.Class.checkMemberAccess(Unknown Source)
	at java.lang.Class.getMethod(Unknown Source)
	at net.sf.jasperreports.engine.print.JRPrinterAWT.initPrinterJobFields(JRPrinterAWT.java:273)
	at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:140)
	at net.sf.jasperreports.engine.print.JRPrinterAWT.printPages(JRPrinterAWT.java:88)
	at net.sf.jasperreports.engine.JasperPrintManager.printPages(JasperPrintManager.java:348)
	at net.sf.jasperreports.engine.JasperPrintManager.printReport(JasperPrintManager.java:239)
	at net.sf.jasperreports.view.JRViewer$20.run(JRViewer.java:1126)
	at java.lang.Thread.run(Unknown Source)
basic: 模态已推进


而后有看到可能是安全问题,所以我在:java.policy的文件里加了以下的几行:

//localhost secuerity
grant codeBase "http://localhost:80/jasper-webapp/applets/*" {
    permission java.lang.RuntimePermission "accessClassInPackage.sun.awt.windows";  
};


为什么还会报同样的错误呢?
有人知道如何处理吗?

你可能感兴趣的:(Java,.net,Security,浏览器,SUN)