I am creating a PDF by getting images from a list object. If I put return statement its giving exception getOutputStream() has already been called for this response. If I set return null then it wont display message at struts page but pdf will be generated. How to achieve both. ie I want to generate a pdf at the same time a success message should be displayed at the struts jsp.