jsp调用.jasper文件报空指针错误
(import包省略了)<%FilereportFile=newFile(application.getRealPath("/report/report1.jasper"...
(import包省略了)
<%
File reportFile = new File(application.getRealPath("/report/report1.jasper"));
String url ="jdbc:mysql://10.40.15.8:3306/kp_user";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Map parameters = new HashMap();
parameters.put("year",2011);
Connection conn = DriverManager.getConnection(url,"root","123");
JasperRunManager.runReportToHtmlFile(reportFile.getPath(),parameters,conn);(这句话报NULL,我看不出是哪出了问题)
response.sendRedirect("/report/report1.html");
%> 展开
<%
File reportFile = new File(application.getRealPath("/report/report1.jasper"));
String url ="jdbc:mysql://10.40.15.8:3306/kp_user";
Class.forName("com.mysql.jdbc.Driver").newInstance();
Map parameters = new HashMap();
parameters.put("year",2011);
Connection conn = DriverManager.getConnection(url,"root","123");
JasperRunManager.runReportToHtmlFile(reportFile.getPath(),parameters,conn);(这句话报NULL,我看不出是哪出了问题)
response.sendRedirect("/report/report1.html");
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询