yu766588220
花公子丶
2015-07-30 08:41

java poi getInpuStream报错

5
  • java
  • struts
  • poi

是这样的,我写了重载了两个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条回答

为你推荐