@John V. thank you your post did help me in the right direction. This is what I have working now:
in my flow.xml
<view-state id="summary" view="summary.jsp">
<on-entry>
<set name="result" value="conversationScope.result" />
<evaluate expression="printPDF" />
</on-entry>
<transition on="startOver" to="startOver" />
</view-state>
in my webflowContext.xml file
<bean id="printPDF" class="com.example.actions.PrintPDF"/>
PrintPDF.class
public class PrintPDF extends AbstractAction {
@Override
public Event doExecute(RequestContext context) {
Result obj = (Result)context.getFlowExecutionContext().getConversationScope().get("result");
HttpServletRequest req = (HttpServletRequest) context.getExternalContext().getNativeRequest();
req.getSession().setAttribute("result", obj);
return success();
}
}
in my controller
@RequestMapping(method=RequestMethod.GET, value="/pdf")
public ModelAndView showPDF(ModelMap model, HttpServletRequest request) {
Result result = (Result)request.getSession().getAttribute("result");
model.addAttribute("result", result);
return new ModelAndView("PDF", model);
}
PDF is defined as a bean in my spring-pdf-views.xml file
<bean id="PDF" class="com.example.view.PDF">
<property name="url" value="/pdf/example.pdf" />
</bean>
That class contains the following:
public class PDF extends AbstractPdfStamperView {
@Override
protected void mergePdfDocument(Map<String, Object> model, PdfStamper stamper,
HttpServletRequest request, HttpServletResponse response) throws Exception {
Result result = (Result)model.get("result");
AcroFields form = stamper.getAcroFields();
//map form fields
and finally the jsp has a link like
<a href="/pdf.html">
I hope that can help someone else. I am not sure if that is the most efficient way of doing it but I am open to any suggestions.