you cannot get OutPutStream in JSP because, If you look at the Java code generated for your JSP, you notice that how "out" implicit objects are created? it is by using response.getOutputStream(). So you will get this run time exception when you try to get OutputStream more than once for same response object.
Instead of JSP, you can forward it to Servlet and do the same in servlet.
Joined: Nov 07, 2006
Thanks Prabhu.how will I generate the outout in this case?I am using struts framework I ll put it in action.Then HOw to generate the pdf?
In WCS7, I am getting the error below while trying to take printout (pdf file) by clicking on button on one jsp.
[12/26/12 12:51:21:873 EST] 00000036 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet /error.jsp in application WC_giftreg. Exception created : java.lang.IllegalStateException: SRVE0199E: OutputStream already obtained
Scenario is by clicking on button of one jsp another jsp window opens that shows the content to print but the second jsp (popup jsp) is getting blank and processing for long time and no printout comes.