2012-5-31 13:32:58 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Java\jdk1.6.0_20\bin;E:\Tomcat6.0\bin
2012-5-31 13:32:58 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2012-5-31 13:32:58 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 560 ms
信息: JK: ajp13 listening on /0.0.0.0:8009
2012-5-31 13:33:10 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/31 config=null
2012-5-31 13:33:10 org.apache.catalina.startup.Catalina start
信息: Server startup in 12239 ms上面的是启动信息,删掉了部分,因为信息太多启动不报错,
启动完成之后,我并没有运行项目,关于项目的任何页面都没有打开
但是,奇怪的是,后台一直输出错误信息:null
检查action中文件下载路径是否正确.
2012-5-31 13:35:21 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:21 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
2012-5-31 13:35:21 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:31 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:31 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:31 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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如下:
public class DownloadActionTrue extends ActionSupport { /**
* generate serialVersionUID
*/
private static final long serialVersionUID = -1502162994976647682L;
// 下载文件原始存放路径
private final static String DOWNLOADFILEPATH = "/upload/";
// 文件名参数变量
private String fileName; public String getFileName() {
return fileName;
} public void setFileName(String fileName) throws UnsupportedEncodingException {
this.fileName = fileName;
} @Override
public String execute() throws Exception { return SUCCESS;
} // 从下载文件原始存放路径读取得到文件输出流
public InputStream getInputStream() throws Exception {
String realPath = DOWNLOADFILEPATH + fileName;
InputStream inputStream = ServletActionContext.getServletContext()
.getResourceAsStream(realPath);
System.out.println(inputStream);
if (null == inputStream) {
System.out.println("检查action中文件下载路径是否正确.");
} return inputStream;
} // 如果下载文件名为中文,进行字符编码转换
public String getDownloadFileName() {
String downFileName = fileName;
try {
downFileName = new String(downFileName.getBytes("iso-8859-1"));
System.out.println(downFileName);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return downFileName;
}
}
配置文件如下:
<action name="download" class="com.yaxing.action.DownloadActionTrue" >
<!-- 设置文件名参数,由页面上传入 -->
<param name="fileName"></param>
<result name="success" type="stream">
<!-- 下载文件输出流定义 -->
<param name="inputName"></param>
<!-- 下载文件类型定义 -->
<param name="contentType">text/plain,application/pdf,application/msword,application/vnd.ms-powerpoint,
image/bmp, image/gif,image/jpeg,image/jpeg,image/png,
text/html,text/html, application/octet-stream ,application/zip;charset=ISO8859-1
</param>
<!-- 使用经过转码的文件名作为下载文件名,downloadFileName属性 对应action类中的方法 getDownloadFileName() -->
<param name="contentDisposition">
attachment;filename="${downloadFileName}"
</param>
</result>
</action>。
然后运行项目:
下载英文名字 正常下载,但是后台报错:
2012-5-31 13:38:12 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)
at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:819)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:519)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)下载中文名字,
页面就报错:
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.
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\Java\jdk1.6.0_20\bin;E:\Tomcat6.0\bin
2012-5-31 13:32:58 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2012-5-31 13:32:58 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 560 ms
信息: JK: ajp13 listening on /0.0.0.0:8009
2012-5-31 13:33:10 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/31 config=null
2012-5-31 13:33:10 org.apache.catalina.startup.Catalina start
信息: Server startup in 12239 ms上面的是启动信息,删掉了部分,因为信息太多启动不报错,
启动完成之后,我并没有运行项目,关于项目的任何页面都没有打开
但是,奇怪的是,后台一直输出错误信息:null
检查action中文件下载路径是否正确.
2012-5-31 13:35:21 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:21 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
2012-5-31 13:35:21 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:31 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:31 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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.
null
检查action中文件下载路径是否正确.
2012-5-31 13:35:31 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: 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如下:
public class DownloadActionTrue extends ActionSupport { /**
* generate serialVersionUID
*/
private static final long serialVersionUID = -1502162994976647682L;
// 下载文件原始存放路径
private final static String DOWNLOADFILEPATH = "/upload/";
// 文件名参数变量
private String fileName; public String getFileName() {
return fileName;
} public void setFileName(String fileName) throws UnsupportedEncodingException {
this.fileName = fileName;
} @Override
public String execute() throws Exception { return SUCCESS;
} // 从下载文件原始存放路径读取得到文件输出流
public InputStream getInputStream() throws Exception {
String realPath = DOWNLOADFILEPATH + fileName;
InputStream inputStream = ServletActionContext.getServletContext()
.getResourceAsStream(realPath);
System.out.println(inputStream);
if (null == inputStream) {
System.out.println("检查action中文件下载路径是否正确.");
} return inputStream;
} // 如果下载文件名为中文,进行字符编码转换
public String getDownloadFileName() {
String downFileName = fileName;
try {
downFileName = new String(downFileName.getBytes("iso-8859-1"));
System.out.println(downFileName);
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return downFileName;
}
}
配置文件如下:
<action name="download" class="com.yaxing.action.DownloadActionTrue" >
<!-- 设置文件名参数,由页面上传入 -->
<param name="fileName"></param>
<result name="success" type="stream">
<!-- 下载文件输出流定义 -->
<param name="inputName"></param>
<!-- 下载文件类型定义 -->
<param name="contentType">text/plain,application/pdf,application/msword,application/vnd.ms-powerpoint,
image/bmp, image/gif,image/jpeg,image/jpeg,image/png,
text/html,text/html, application/octet-stream ,application/zip;charset=ISO8859-1
</param>
<!-- 使用经过转码的文件名作为下载文件名,downloadFileName属性 对应action类中的方法 getDownloadFileName() -->
<param name="contentDisposition">
attachment;filename="${downloadFileName}"
</param>
</result>
</action>。
然后运行项目:
下载英文名字 正常下载,但是后台报错:
2012-5-31 13:38:12 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407)
at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:819)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:519)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)下载中文名字,
页面就报错:
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.
解决方案 »
- Spring 能否对普通类注入接口,报错
- java读取和编辑pdf文件相关
- CPU占用100%。怎么解决一下啊?
- 求教高手!不识别Struts2标签!
- jforum论坛二次开发--添加页面
- 关于JAVA的几道题,谁会做?谢谢!
- j2ee开发问题
- 初学者很迷茫:axis开发web service的过程和步骤是什么?有什么特别的工具吗?是不是要自己编写服务,要自己编写soap,wsdl.uddi等等吗?请指教,谢谢!
- (附原代码)高手请帮忙,在线等!~`
- JBuilder7下写的CMP部署成功,但是插入的记录没有写入数据库
- struts2中如何配置过滤器
- this.getHibernateTemplate() 为null
或者写段代码输出request.remoteAddr看看请求来自哪儿