You should be handling this in a servlet, not a JSP. JSPs have so many assumptions about output of HTML. In this case your JSP is getting the output stream and writing a bunch of output before it gets to your code.
Wel im gonna try this on a servlet, but i would like to know why this reponse already been set or getOutputStream() for this response is already been used comes even when im nt using the response object any where else. except setting the header of the page.
Joined: Mar 22, 2005
That's a questions about how JSP works. You might have a look at the Java source code that gets produced from the JSP page (if you're using Tomcat it's somewhere deep in the "work" directory). That should show you how the stream is used in places other than the ones where you use it.
Joined: Apr 25, 2006
thanks william and ulf for your valuable suggestions i have been able to implement the poi and create sheet thru servlets.