-
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
i guess these exceptions are caused by the buffer size, in other words, the default buffer were fulled and has been submitted to client.
you can try extend ServletOutputStream and enlarge the buffer.
Asked: 2011-06-22 06:18:08 +0800
Seen: 1,245 times
Last updated: Jul 10 '11
ZK studio and eclipse outline problem
ZK Package configuration problem
Eclipse Autocomplete not working in ZUL files...
Syntax Error mark ... help me!
Manual Installation of ZK Studio
Can't see button text whilst running simple demo
Adding Vbox to Center layout in Java