(Struts2文件下载)Can not find a java.io.InputStream with the name [inputStream] in the invocation stack

如何适配自定义激光雷达数据到LIO-SAM:解决ring和time参数缺失问题 本文详细解析了如何将非标准激光雷达(如速腾、Livox)适配到LIO-SAM框架中,重点解决ring和time参数缺失问题。提供了从源码修改到通用适配中间件的多层级解决方案,并包含实机测试与性能调优指南,帮助开发者高效完成雷达数据适配。 阅读详情
转载自  kaisep
最终编辑  yeyeok

2010-1-22 9:45:03 org.apache.struts2.dispatcher.StreamResult doExecute
严重: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <param name="inputName"> tag specified for this action.
2010-1-22 9:45:03 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <param name="inputName"> tag specified for this action.
at org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:189)
at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)

==========================解决办法===========================
这个错误报的真有点误导人呀,我还一直以为我struts.xml中<param name="inputName">inputStream</param>和action中的方法名getInputStream()不一致的问题,大家如果也碰到此类问题,直接打印
InputStream in=ServletActionContext.getServletContext().getResourceAsStream(realPath);
System.out.println(in);

如果打印为NULL的话,恭喜您,问题得以解决,问题的原因是这个流的realPath路径错误,像我的,
//  String realPath=ServletActionContext.getServletContext().getRealPath("/uploadImages")+ "/"+name; 路径错误

   String realPath="/uploadImages/"+name;正确的
=====================================================
没明白的,请看下面的详细说来
怪呀,我的配置应该没错呀
页面上:
<a href="fileDownload.action?fileName=<s:property value ="imageName" />">下载此图片</a>
struts.xml中
----------------------------------------------------------
<!-- 文件下载,支持中文附件名 -->
   <action name="fileDownload"
    class="com.test.action.filedown.FileDownloadAction">
    <result name="success" type="stream">
     <!-- 动态文件下载的,事先并不知道未来的文件类型,那么我们可以把它的值设置成为:application/octet-stream;charset=ISO8859-1 ,注意一定要加入charset,否则某些时候会导致下载的文件出错; -->
     <param name="contentType">
     application/octet-stream;charset=ISO8859-1
     </param>
     <param name="contentDisposition">
      attachment;filename="${downloadFileName}"
     </param>
     <!-- 使用经过转码的文件名作为下载文件名,downloadFileName属性
      对应action类中的方法 getDownloadFileName() 其中特殊的代码就是${downloadFileName},它的效果相当于运行的时候将action对象的属性的取值动态的填充在${}中间的部分,我们可以认为它等价于+action. getDownloadFileName()。 -->
     <param name="inputName">inputStream</param>
     <param name="bufferSize">4096</param>
    </result>
   </action>
----------------------------------------------------------
action中
----------------------------------------------------------
private String fileName;// 初始的通过param指定的文件名属性 set get

/** 文件名 转换编码 防止中文乱码*/
public String getDownloadFileName() {
   String fileName=ServletActionContext.getRequest().getParameter("fileName");
   String downFileName = fileName;
   try {
    downFileName = new String(downFileName.getBytes(), "ISO8859-1");
   } catch (Exception e) {
    e.printStackTrace();
   }
   return downFileName;
}
//下载的流
public InputStream getInputStream() {
   String name=this.getDownloadFileName();
//  String realPath=ServletActionContext.getServletContext().getRealPath("/uploadImages")+ "/"+name; 路径错误
   String realPath="/uploadImages/"+name;
   InputStream in=ServletActionContext.getServletContext().getResourceAsStream(realPath);
   if(null==in){
    System.out.println("Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <param name=\"inputName\"> tag specified for this action.检查action中文件下载路径是否正确.");   
   }
   return ServletActionContext.getServletContext().getResourceAsStream(realPath);
}

@Override
public String execute() throws Exception {
   return SUCCESS;
}

使用virtuoso gds转lef操作方法 2) 然后,需要创建Pin,这里Pin的概念不同于label/text,是有实际金属的,二者的区别类似于pr中的port和terminal。1) 首先,需要画prBoundary,这个用drawing层的prBoundary画是不行的,不过建议pr阶段就把prBoundary转到gds里,在virtuoso layout中画prBoundary就比较容易。另外,用Create - Create Pin也可以创建pin,更适用于PG pin,操作时先给pg shape打label,最好放正中间。 阅读详情

相关推荐

美团mtgsig 3.1.0算法还原:从加密入口到d1生成的完整链路拆解

本文详细拆解了美团mtgsig 3.1.0签名算法的完整逆向过程。通过定位加密入口函数eH,理清a6、a5、a8到d1的生成依赖链,并运用插桩技术,在JSVMP混淆环境下逐步还原了核心参数的生成逻辑,为逆向工程实践提供了清晰的纯算还原方法论。

oo7890的博客 776

Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the

关于stuts的下载文件问题 具体异常: Cannotfindajava.io.InputStreamwiththename[inputStream]intheinvocationstack.Checkthe<paramname="inputName">tagspecifiedforthisaction. 就是这个问题,从一点多纠结了,几...

zhupengqq的博客 996

在Proteus中用80C51模拟4线SPI点亮OLED屏幕

在Proteus里用80C51模拟4线SPI控制OLED屏幕使其显示图案(汇编实现)。

Connor3093的博客 5002

Can not find a java.io.InputStream with the name [inputStream] in the invocation stack问题解决

原文地址:not find a java.io.InputStream with the name [inputStream] in the invocation stack问题解决">Can not find a java.io.InputStream with the name [inputStream] in the invocation stack问题解决作者:digense具体异常是这句

dongfangbubai1的专栏 1507

Linux环境下使用线程方式操作UART读写功能

本文介绍Linux环境下使用线程方式操作UART的方法,实现了串口打开,关闭,发送数据,接收数据功能,还编写测试代码,验证该功能。

mftang的博客 2078

搭建Java集成开发环境IntelliJ IDEA

package net.huawei.p01.t02;/** * 功能:输出一条信息 * 作者:华卫 * 日期:2022年03月24日 */ public class HelloWorld { public static void main(String[] args) { // arguments System.out.println("Hello Java World~"); } }

qq_67308063的博客 475

strut2下载文件的“ <param name="inputName"> tag specified for this action.”异常

具体异常是这句话:Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the tag specified for this action. 1.文件路径不对,根本就没有取到文件。这种情况下,可以将获得InputStream的那条语句放在system.out

a243932069的专栏 9538

R语言影像组学实战:从医学图像到预测模型的完整流程(附代码)

本文详细介绍了使用R语言进行影像组学分析的完整实战流程。从环境搭建、数据准备,到医学图像的特征提取与筛选,再到利用机器学习构建预测模型并进行评估,提供了清晰的步骤和可运行的R代码示例,帮助研究者和数据分析师掌握从医学图像到临床预测模型的核心技术。

qsc901234的博客 732

Can not find a java.io.InputStream with the name [inputStream] in the invocation

java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. 其实就是因为路径不对引起的。下载只能是相对路径,不要弄上硬盘的路径,这样就肯定抛这个异常啦。不要犯类似的错误了。 //从下载...

wjt276的专栏 290

SAP-HR 模块 PPOSE 的详细信息标签页增强

步骤1:T-CODE : SE11 创建一个名为 HRI9106 的结构 命名:HRI + 91 + 两位数字。人事管理 - 组织管理 - 集成新信息类型 - 将信息类型添加为明细范围中的标签页。步骤6:SE51 查看 7000屏幕,修改屏幕属性 让其更美观。步骤3:T-CODE : SM30维护 T777I 表。步骤5:PPCI 新建 7000屏幕用于显示。标签页 IT 开头 + 信息类型 9106。步骤2:T-CODE : PPCI。步骤4:T-CODE : SPRO。

常回来看看呀!! 1627

杰理外挂flash使用教程(四):制作fat32文件系统格式的资源文件

本文档提供了FAT文件系统镜像生成与资源打包的完整指南,包含两种实现方案:推荐的WSL/Ubuntu环境方案和Windows原生方案。详细说明了从创建空白镜像、格式化、资源文件复制到最终打包为设备可用的res.bin文件的完整流程,并对比了FAT32与FAT16的特性差异。文档还包含关键文件说明、使用注意事项和典型应用场景,适用于嵌入式系统开发、固件升级等场景。

qq_42014563的博客 1339

struts2文件下载出现Can not find a java.io.InputStream with the name [imageStream] in the invocation stack.

struts2就行文件下载时出现如下错误: Servlet.service() for servlet default threw exception   java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [imageStream] in the invocation st

xiaobiaobiao521的专栏 1682

RK3568平台(网络篇)WIFI模块RTL8821CU调试

RTL8821CU是瑞昱半导体推出的usb接口的wifi,下面的教程将介绍如何将RTL8821CU移植到rk3588的平台上。移植usb wifi需要修改的文件Android hal层需要修改的文件//kernel需要修改的文件kernel/arch/arm64/boot/dts/rockchip/rk3399-tve1030g.dtsi //除去板上的sdio的wifi。

weixin_49303682的博客 3903

struts2文件的下载,Can not find a java.io.InputStream with the name [inputStream] in the invocation stack....

Struts Problem Report Struts has detected an unhandled exception: Messages: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the tag specifi...

weixin_30553065的博客 131

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

struts文件下载 Can not find a java.io.InputStream with the name [downLoad] in the invocation stack与乱码问题

在做一个使用struts做一个文件下载的操作时,先后遇到了两个问题。 首先是遇到了Can not find a java.io.InputStream with the name [downLoad] in the invocation stack.Check the <param name="inputName"> tag specified for this action.这个异...

Cheang_Bokgaai的博客 629

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack.

1、错误描述八月 14, 2015 4:22:45 下午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error 严重: Exception occurred during processing request: Can not find a java.io.InputStream with the name [downloadFile]

游海东的技术专栏 5745

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

(文件下载)Can not find a java.io.InputStream with the name [inputStream] in the invocation stack

2010-1-22 9:45:03 org.apache.struts2.dispatcher.StreamResult doExecute 严重: Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the tag specified for this ac

l345480242的专栏 1183

Can not find a java.io.InputStream with the name [inputStream] in the invocation stack

今天实现Excel导出功能,结果总是提示下面的错误: 18:32:04,793 ERROR StreamResult:23 - Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the tag specified for this action. 看下源码

Developer of XingKong22star 2470

Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack问题解决

具体出现异常为: Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack. Check the tag specified for this action. 据说可能是以下两种方法导致: 1.文件路径不对,根本就没有取到文件。这种情况下,可以将获得InputStrea

u010017937的专栏 486

Can not find a java.io.InputStream with the name [inputStream] in the invocation stack. Check the <

最近项目需要用到上传下载,以前学jsp的时候直接用的是smartUpload,现在学的框架但是老师只是简单地教了框架的内容 对struts文件上传和下载没有涉及,没办法只能自己自学了!结果出现了上面的问题。 这个问题的根本原因网上都有说出来,但是没有给出的解决方案。原因是要返回的流为空,文件的路径有误导致文件的输入流为空! 所以最好在逻辑处理那块输出的你要下载文件的路径看是不是你要下载的路径

一身都是月 1978

Can not find a java.io.InputStream with the name [...] in the invocation stack. ...

3379748 [qtp33117621-12] ERROR org.apache.struts2.dispatcher.StreamResult - Can not find a java.io.InputStream with the name [joGroupMembers] in the invocation stack. Check the tag specified for this

逍遥子曰: 2568

struts2文件下载出现Can not find a java.io.InputStream with the name的错误

今天在用struts2就行文件下载时出现如下错误: Servlet.service() for servlet default threw exception   java.lang.IllegalArgumentException: Can not find a java.io.InputStream with the name [imageStream] in the invocatio

chenqqabcdchenqqabcd的专栏 807

Struts2 下载 Can not find a java.io.InputStream with the name [downloadFile] in the invocation stack

1、检查"后面属性的那个get方法.  去get  后面第一个字母小写  2、资源路径 不能用虚拟路径  自己手写。

happyandyo的博客 411
上一篇: java学习笔记(线程池)
下一篇: ExtJs学习笔记(XTemplate的使用)
Peditable
博客等级 码龄16年 11粉丝 47原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值