首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

ajax4jsf解决办法

2012-02-20 
ajax4jsf我在做一个网站,用的是MyFaces,还用到了Ajax4JSF。但是原来用JSP实现的文件下载功能就不好使了,出

ajax4jsf
我在做一个网站,用的是MyFaces,还用到了Ajax4JSF。但是原来用JSP实现的文件下载功能就不好使了,出现下面的异常,请问是怎么回事呀?怎么改正呢?
java.lang.IllegalStateException:   Servlet   response   already   use   stream,   Writer   not   possible
at   org.ajax4jsf.framework.ajax.xmlfilter.FilterServletResponseWrapper.getWriter(FilterServletResponseWrapper.java:220)
at   org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
at   org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
at   org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)
at   org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
at   org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
at   org.apache.jsp.pages.download_jsp._jspService(download_jsp.java:216)
at   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at   org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at   org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at   org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at   org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
at   org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at   org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
at   org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
at   org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at   javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at   org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   cn.com.pbi.netmgr.web.morning.ExceptionFilter.doFilter(ExceptionFilter.java:55)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)


at   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at   java.lang.Thread.run(Thread.java:595)

[解决办法]
Servlet response already use stream, Writer not possible
输出流已经被使用了 你的程序有问题 你仔细检查下
[解决办法]
是不是你的stream没有被flush或是close啊,你看看程序,应该是程序的问题

[解决办法]
页面上出现拉2个contenttype
[解决办法]
你用AJAX在JSF上实现了什么功能?

热点排行