You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ge...@yahoo.com on 2008/06/11 23:37:42 UTC

Struts Excel download using POI... throwing java.lang.IllegalStateException

I have a button on jsp on clicl of which the request goes to the Struts action where I am trying to use POI to create a excel file . It goes back to the right jsp as per the "forward" but no download option. I keep getting the following exception...

Appreciate if anyone can help me with this..
java.lang.IllegalStateException
[6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R 	at com.ibm.wps.pe.pc.legacy.impl.PortletResponseImpl.setHeader(PortletResponseImpl.java:450)
[6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R 	at javax.servlet.http.HttpServletResponseWrapper.setHeader(HttpServletResponseWrapper.java:194)
[6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R 	at com.strykercorp.e3s.stellent.actions.SearchResultsAction.execute(SearchResultsAction.java:275)
[6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R 	at com.ibm.wps.portlets.struts.WpsRequestProcessor.processActionPerform(WpsRequestProcessor.java:344)
[6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R 	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
[6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R 	at com.ibm.wps.portlets.struts.WpsRequestProcessor.processNewActionUri(WpsRequestProcessor.java:863)

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


Re: Struts Excel download using POI... throwing java.lang.IllegalStateException

Posted by Struts_tania <ge...@yahoo.com>.
Chris,
Thanks for your reply..

How can I avoid this..
I want to download the excel file  in the same screen where the download
button was there.
So at the end I was forwarding to that jsp..
Should I not have a forward int he action class?If so how do I achieve that.

Thanks



Chris Pratt wrote:
> 
> You can either send the excel file or redirect the user, not both.
> You're getting the error because once you've sent the excel file,
> you're trying to send the redirect but the stream has already been
> used.
>   (*Chris*)
> 
> On Wed, Jun 11, 2008 at 2:37 PM,  <ge...@yahoo.com> wrote:
>> I have a button on jsp on clicl of which the request goes to the Struts
>> action where I am trying to use POI to create a excel file . It goes back
>> to the right jsp as per the "forward" but no download option. I keep
>> getting the following exception...
>>
>> Appreciate if anyone can help me with this..
>> java.lang.IllegalStateException
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at
>> com.ibm.wps.pe.pc.legacy.impl.PortletResponseImpl.setHeader(PortletResponseImpl.java:450)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at
>> javax.servlet.http.HttpServletResponseWrapper.setHeader(HttpServletResponseWrapper.java:194)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at
>> com.strykercorp.e3s.stellent.actions.SearchResultsAction.execute(SearchResultsAction.java:275)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at
>> com.ibm.wps.portlets.struts.WpsRequestProcessor.processActionPerform(WpsRequestProcessor.java:344)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at
>> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at
>> com.ibm.wps.portlets.struts.WpsRequestProcessor.processNewActionUri(WpsRequestProcessor.java:863)
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Struts-Excel-download-using-POI...-throwing-java.lang.IllegalStateException-tp17787836p17811198.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts Excel download using POI... throwing java.lang.IllegalStateException

Posted by Chris Pratt <th...@gmail.com>.
You can either send the excel file or redirect the user, not both.
You're getting the error because once you've sent the excel file,
you're trying to send the redirect but the stream has already been
used.
  (*Chris*)

On Wed, Jun 11, 2008 at 2:37 PM,  <ge...@yahoo.com> wrote:
> I have a button on jsp on clicl of which the request goes to the Struts action where I am trying to use POI to create a excel file . It goes back to the right jsp as per the "forward" but no download option. I keep getting the following exception...
>
> Appreciate if anyone can help me with this..
> java.lang.IllegalStateException
> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at com.ibm.wps.pe.pc.legacy.impl.PortletResponseImpl.setHeader(PortletResponseImpl.java:450)
> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at javax.servlet.http.HttpServletResponseWrapper.setHeader(HttpServletResponseWrapper.java:194)
> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at com.strykercorp.e3s.stellent.actions.SearchResultsAction.execute(SearchResultsAction.java:275)
> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at com.ibm.wps.portlets.struts.WpsRequestProcessor.processActionPerform(WpsRequestProcessor.java:344)
> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr     R     at com.ibm.wps.portlets.struts.WpsRequestProcessor.processNewActionUri(WpsRequestProcessor.java:863)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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