原因:妳要下載的文件不存在,導致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;?
}