Good morning list,

A question about struts2 + PDF. Struts2 + itext5.x.

In action class:
==========================================
HttpServletResponse res  = ServletActionContext.getResponse();
res.setContentType("application/pdf");
Document document = new Document();
PdfWriter.getInstance(document,
res.getOutputStream());
document.open();
...
document.close();

Always got the following errors:
====================================
ERROR tags.BaseSimpleTag.doEndTag:? - ERROR: getOutputStream() has already been called for this response
org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response

Is there a way to fix it and is there any good online doc about how struts2 + itext pdf file generation?

Also, how do you setup the default PDF file name?

Thanks a lot!
Emi

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

Reply via email to