I am trying to write a simple pdf export functionality using primefaces p:dataExporter. My Code is as below
my development environment is JSF-2.0, Primefaces-3.4.2, Eclips- JUNO, GlassFish
xhtml page
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
>
<h:head>
<title>Pdf Export</title>
</h:head>
<h:body>
<h:form id="myForm" >
<p:dataTable id="tableId" var="car" value="#{tableBean.carsSmall}">
<p:column headerText="Model">
<h:outputText value="#{car.model}" />
</p:column>
<p:column headerText="Year">
<h:outputText value="#{car.year}" />
</p:column>
</p:dataTable>
<h:commandLink ajax="false" >
<p:graphicImage library="images" name="pdf.png" width="40" height="40" />
<p:dataExporter target="tableId" type="pdf" fileName="car"></p:dataExporter>
</h:commandLink>
</h:form>
</h:body>
</html>
my dataTable is populated correctly there is no issue there but when I click for Export nothing happens. Console also doesn't give any message. I have kept iTextpdf-5.4.0.jar and poi-3.2-FINAL.jar in my webapp library. Do I need to do anything else here? Please give me some idea what I am missing?
EDIT-1
I tried using iTextpdd-2.1.7 as suggested in the comment below but still the same problem exist and I am not able to export to pdf.
When I click export the console gives me warning message as below. Is this warning message creating any problem in the export
WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context
/{project name}, because request parameters have already been read, or
ServletRequest.getReader() has already been called
EDIT-2
Today I tried the same code in RAD-Wehsphere/iText 2.1.7 and Export is working fine in that environment. I am able to export dataTable in the pdf file. There must be something that is missing in the Eclips- JUNO, GlassFish environment.
TIA