I just wanted to reply that I found an easy solution that works well, and the
customer is happy with it.  Instead of opening the PDF report inline in a
new browser window, I am now setting the response header disposition type to
be "attachment" instead of "inline".  So when the report is streamed back,
the user gets a standard Windows prompt to Open, Save, or Cancel the PDF
file.   If there are validation errors, the backing bean simply posts a
FacesMessage with the error, and returns null to redisplay the parameter
page.

The code change was like this:

        FacesContext context = FacesContext.getCurrentInstance();
        HttpServletResponse response = (HttpServletResponse) context
                .getExternalContext().getResponse();
        response.setHeader("Content-Type", "application/pdf");
        response.setHeader("Content-Disposition", "attachment; filename=" +
fileName);

-- 
View this message in context: 
http://www.nabble.com/validation-with-commandLink-and-target-%3D-_blank-tf3601961.html#a10083530
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to