當前位置:編程學習大全網 - 網站源碼 - Can 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

原因:妳要下載的文件不存在,導致inputStream為null,所以報了這個錯誤;查看官方源代碼,

如下:

if?(inputStream?==?null)?{

//?Find?the?inputstream?from?the?invocation?variable?stack

inputStream?=?(InputStream)?invocation.getStack().findValue(conditionalParse(inputName,?invocation));

}

if?(inputStream?==?null)?{

String?msg?=?("Can?not?find?a?java.io.InputStream?with?the?name?["?+?inputName?+?"]?in?the?invocation?stack.?"?+

"Check?the?<param?name=\"inputName\">?tag?specified?for?this?action.");

LOG.error(msg);

throw?new?IllegalArgumentException(msg);

}

解決辦法:

在DownloadAction.java類中定義壹個方法:

public?InputStream?getImageStream(){

return?stream;?

}

  • 上一篇:夢幻高級西遊法寶的合成公式
  • 下一篇:股票裏,什麽叫收小陰,小陽?
  • copyright 2024編程學習大全網