HI Rocco:
If your portlet is portlet 2.0 specification compliant, it is usually done serving resource.
If you are extending MVCPortlet in your porltet, you can implement this method
1public void serveResource(ResourceRequest resourceRequest,
2 ResourceResponse resourceResponse) throws IOException
In which resourceResponse you can wrte the pdf file.
1
2public void serveResource(ResourceRequest resourceRequest,
3 ResourceResponse resourceResponse) throws IOException,
4 PortletException {
5OutputStream os = resourceResponse.getPortletOutputStream();
6....
7....
8JasperExportManager.exportReportToPdfStream(print, os);
9}
Which results in a pdf download.
For invoking this you can use this tag
1<portlet:resourceURL></portlet:resourceURL>
Hope that helps.
Please sign in to flag this as inappropriate.