struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Syed Niaz" <niaz_sy...@rediffmail.com>
Subject Re: Re: opening with MS-EXCEL
Date Fri, 01 Feb 2002 13:57:26 GMT

Hi ,

I get this error when the following line was included in the Actionclass
"javax.servlet.ServletOutputStream out =	httpservletresponse.getOutputStream();"

type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented
it from fulfilling this request.

exception 

java.lang.IllegalStateException: getOutputStream() has already been called for this response
	at org.apache.catalina.connector.ResponseBase.getWriter(ResponseBase.java:755)
	at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:162)
	at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:166)
	at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:158)
	at org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:205)
	at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:176)
	at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:198)
	at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:193)
	at org.apache.jsp.TrialResult$jsp._jspService(TrialResult$jsp.java:71)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
	at org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.java:1758)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
	at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Thread.java:484)



On Thu, 31 Jan 2002 Melanie Harris wrote :
> Someplace at the end of your Action Class you could
> set the mime type and:
> String contentType = "application/xls";  //i believe
> this is the correct mime type for excel
> byte[] fromDB = lobHandler.getByteStreamFromDB();
> 
> if (contentType.equals("text/richtext"))
> 						response.setContentType(contentType);
>  						javax.servlet.ServletOutputStream out =
> response.getOutputStream();
>  										//out.write((byte[])
> request.getAttribute("binaryData"));    // where data
> is byte[] containing the filedata
>  										out.write(fromDB); 
>  										out.flush();
>  										out.close();
> 										return null;
> 
> 
> 
> --- Syed  Niaz <niaz_syed1@rediffmail.com> wrote:
> > 
> > Hi 
> > 
> > Can anyone send me a sample code for opening an
> > MS-EXCEL using struts .
> > 
> > ... or some tips on how/where to set the
> > content-type ,etc
> > 
> > Thanks
> > 
> > Regards,
> > Syed Niaz 
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions! 
> http://auctions.yahoo.com
 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message