In my web application, I'm experimenting with Jasper Reports. In the scenario, I call a servlet, which will run the specific report. When I run a report with .pdf or .xls output, everything is fine. But when I run a report with a .rtf format, after I close the report output, it seems the servlet is recalled with no parameters, and eventually a NullPointerException is thrown. Below has to be the problem code, because it is the only place that it differs for the different outputs.