-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Dear All,
I have to view a jasper report inside zul page.
I am using jasper reports applet version 4.0.0.I have included the applet tag <n:applet> inside zul page to view a jasper report using embedded viewer class, this applet calls a servlet that gets the jasperPrint object from the Http Session and writes back the result as application/octet-stream.
The report appears with no exceptions. But when I make any action after report preview like select or save etc…, the exception are thrown:
1. java.lang.IllegalStateException: Cannot reset buffer after response has been committed
2. Servlet receives unexpected IllegalStateException: Writer already obtained
Note that it’s working successfully with tomcat application server, and no exceptions happen, the exception only appears when deploying in websphere application server ver. 6.1 or 7.0.
On the other hand, when deploying the same servlet outside the ZK project, it works fine with all servers types mentioned above.
sample of servlet code...
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { JasperPrint jasperPrint = (JasperPrint) request.getSession().getAttribute(ImageServlet.DEFAULT_JASPER_PRINT_SESSION_ATTRIBUTE); if (jasperPrint != null) { ServletOutputStream ouputStream = null; ObjectOutputStream oos = null; try { response.setContentType("application/octet-stream"); ouputStream = response.getOutputStream(); oos = new ObjectOutputStream(ouputStream); oos.writeObject(jasperPrint); oos.flush(); ouputStream.flush(); } catch(Exception e) { e.printStackTrace(); } finally { oos.close(); ouputStream.close(); } } }
Any help will be appreciated.
Thank You
Asked: 2011-06-16 06:04:57 +0800
Seen: 473 times
Last updated: Jun 16 '11