you've commented out the response stuff in your code, and i guess it's after your null pointer problem anyway. but you may have use uit.toString() eventually.
have you tried driver = new Driver(InputSource, OutputStream) ... driver.run()
Raf Geusens wrote:
Hi everybody,
I started using Fop today, because I need it urgently for a project, but I've got some trouble running my first piece of code in it.
This is the most important part of code, it's part of a jsp-page.
The application always gives at NullPointerException error when it reaches driver.render(...). First I tought one of the parameters was null, but when I wrote them to the browser they seemed to be fine ([EMAIL PROTECTED] you know). I also wrote the other parameters like driver, file etc... to the browser and none of them is equal to null.
So, what can be the solution to my NullPointerException, any ideas anyone?
try {
XSLTInputHandler input = new XSLTInputHandler(new File(file),new File (props.getString("pdfFase")));
ByteArrayOutputStream uit = new ByteArrayOutputStream();
response.setContentType("application/pdf");
Driver driver = new Driver(); driver.setLogger(log); driver.setRenderer(Driver.RENDER_PDF); driver.setOutputStream(uit);
driver.render(input.getParser(), input.getInputSource());
/*byte [] content = uit.toByteArray(); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush();*/
} catch (Exception e) { %><%= e %><% e.printStackTrace(); }
Greetings, Raf
_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com