You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Jignesh Shah <js...@mdnotes.com> on 2003/08/05 21:53:27 UTC

PDF generation and JavaMail

Hi,
 
I am facing problem generating a PDF and subsequently mailing it using
JavaMail. Following is a step by step explanation of what I am trying to
achieve:
 
1.	A JSP page displays a list of documents with options to view,
email and print the documents
2.	When the user clicks on the email icon a pop up window is
generated which asks for the "To" "From" and "Sub" email fields. The
command I use to generate pop up window is: 
            onclick="javascript:pop_win =
window.open('popup.jsp?<%=qry2%>','pop_win','width=400,height=300,scroll
bars=yes');
                              pop_win.focus();
I am unable to validate the form fields in the pop up window before
submitting it to a servlet but that is not a very major issue
3.	The data from the Popup window is than captured in the servlet
using the request object. Pop up window exits automatically after the
submit button is clicked.
4.	This servlet does some data processing and builds a xsl template
and xml. Than I forward the request to another servlet using the
command:
 
getServletContext().getRequestDispatcher("/report/fop").forward(request,
response);
      I also add a few attributes to the request object here.
5.	This servlet generates dynamic pdf correctly. However while
generating static pdf it throws a socket reset by peer exception at the
requestDispatcher line.
6.	The decision to generate dynamic or static pdf is taken based on
a request attribute set by me in the servlet which processes the popup
information
7.	Independently JavaMail works fine, Static pdf is also
successfully generated but without request parameters being passed. The
problem is only when I try to integrate all these features together.
 
Can somebody please help me how to achieve this functionality. If there
is a better design approach I can implement that and try it.
 
Thanks
 
Jignesh