问题描述
- java poi getInpuStream报错
-
是这样的,我写了重载了两个getInputStream方法,当调用不带参数的方法时,运行正常,当调用带参的方法则报 Can not find a java.io.InputStream with the name [inputStream] in the invocation stack的错误
代码如下:
Struts2配置:<action name="ajaxUserDataExportAction" class="com.action.AjaxUserDataExportAction"> <result type="stream"> <param name="ContentType">application/vnd.ms-excel</param> <param name="inputName">inputStream</param> <param name="contentDisposition">filename="user.xlsx"</param> </result> </action>
spring配置
<bean id="userManageService" class="com.hy.serviceimp.UserManageService"> <property name="baceDaoImp" ref="baceDaoImp"></property> </bean>
调用代码:
调用带参数的getInputStream,程序报错
public InputStream getInputStream() { System.out.println(userManageService.getInputStream(curPage, pageSize, sortName, sortOrder, searchValue)==null); return userManageService.getInputStream(curPage, pageSize, sortName, sortOrder, searchValue); }
调用不带参数的,则运行正常
public InputStream getInputStream() { System.out.println(userManageService.getInputStream()==null); return userManageService.getInputStream(); }
解决方案
错误已经找到,是数据插入错误引起的
时间: 2024-10-20 10:39:56