I am facing with a problem.
I am using flying saucer to produce pdf. I have a jsp page and a class.
In my jsp I am creating instance of that class and try to output pdf but I am getting error.

My jsp:
Java Code:
<meta http-equiv="Content-Type" content="application/pdf; charset=UTF-8">

ExportToPDF pdf = new ExportToPDF();
pdf.createPDF(request, response, session);
ExportToPDF Class:
Java Code:
public void createPDF(HttpServletRequest request, HttpServletResponse response, HttpSession session) throws IOException, ParserConfigurationException, 
			SAXException, DocumentException {
URL url	= new URL(this.getUrlString());
HttpURLConnection urlConn = null;
urlConn = (HttpURLConnection) url.openConnection();
InputStream byteStream 	= urlConn.getInputStream();
OutputStream os = response.getOutputStream();
Document doc = tidy.parseDOM(byteStream, null);  
ITextRenderer renderer = new ITextRenderer();  
renderer.setDocument(doc, null, new XhtmlNamespaceHandler());  
The problem is about sending request and response object ?
Thank you.