花公子丶
2015-07-30 08:41
采纳率: 60%
浏览 1.6k
已采纳

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();
    }
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • 花公子丶 2015-07-30 09:13
    已采纳

    错误已经找到,是数据插入错误引起的

    点赞 评论

相关推荐 更多相似问题