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,scrollbars=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

  1. 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.
  2. 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.

  1. This servlet generates dynamic pdf correctly. However while generating static pdf it throws a socket reset by peer exception at the requestDispatcher line.
  2. 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
  3. 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

Reply via email to