At 2:33 PM -0500 2002/06/12, Nekkalapudi, Viplava wrote:
>Could you please explain this.
>I need to return a NULL ActionForward from my generate report action,
>because the response is already committed to the output stream.
>The PDF file is opened in a new window and not in the input JSP page.
>I want to clear the error messages from the input page.


Don't write the PDF to the output stream when you do now.  Instead, 
return an ActionMapping which causes the input page to be refreshed. 
In that input page, have a conditional block which recognizes that 
things are good to make the PDF, and inside that block, cause the 
browser to load the PDF.

You could do that with <meta http-equiv="refresh"...> (but then i 
don't think you can make it happen in a new window) or you could do 
it with javascript.

If you insist on generating the PDF when you do now, write it to the 
filesystem instead, and have the automated bit load the PDF directly; 
alternatively, defer generating the PDF to a separate action (which 
is probably a cleaner separation of concerns anyway) and have the 
automated bit call that action, causing the PDF to be generated.

Does that make sense?

Joe



>
>
>-----Original Message-----
>From: James Mitchell [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, June 12, 2002 1:13 PM
>To: Struts Users Mailing List
>Subject: RE: Issue with struts when generate reports from action class
>
>
>return the successful page with a meta-refresh to the pdf
>
>or use javascript
>
>HTH
>
>James Mitchell
>Software Engineer\Struts Evangelist
>Struts-Atlanta, the "Open Minded Developer Network"
>http://struts-atlanta.open-tools.org
>
>>  -----Original Message-----
>>  From: Nekkalapudi, Viplava [mailto:[EMAIL PROTECTED]]
>>  Sent: Wednesday, June 12, 2002 1:55 PM
>>  To: 'Struts Users Mailing List'
>>  Subject: Issue with struts when generate reports from action class
>>
>>
>>
>>      Generating a PDF report from struts action class using 'iText'
>>  works fine.
>>      But We have a small issue related with Struts.
>>  When there is a validation error, The errors display on the input page.
>>  So we enter required data, and click 'Generate PDF report',
>>  Opens up Acrobat reader with the report.
>>  In this case how can we clear the errors on the input page?
>>  Right now, the error message still displays even after I open report.
>>  (We don't want to open PDF in the same browser window, So we used
>>  content-disposition as 'attachment').
>>  Is there any way to refresh the input page, once the response is
>>  submitted.
>>
>>  Thanks,  Vip.
>>
>>
>>  -----Original Message-----
>>  From: Vincent Aumont [mailto:[EMAIL PROTECTED]]
>>  Sent: Tuesday, April 30, 2002 7:45 PM
>>  To: Struts Users Mailing List
>>  Subject: Re: some PDF stuff
>>
>>
>>
>>
>>  > >  response.setHeader("Content-disposition","attachment; filename=" +
>>  > filename);
>>  >
>>  >  I don't have a file name for the pdf I generate (may be I can
>>  have one).
>>
>>  Any name will do. It's the name the browser uses should your user
>>  decide to
>>  save
>>  the document to disk.
>>
>>  >  The Action class returns a NULL Action Forward.
>>
>>  Same here.
>>
>>  -Vincent.
>>
>>
>>  --
>>  To unsubscribe, e-mail:
>>  <mailto:[EMAIL PROTECTED]>
>>  For additional commands, e-mail:
>>  <mailto:[EMAIL PROTECTED]>
>>
>>  --
>>  To unsubscribe, e-mail:
>>  <mailto:[EMAIL PROTECTED]>
>>  For additional commands, e-mail:
>>  <mailto:[EMAIL PROTECTED]>
>>
>>  --
>>  To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


-- 
--
* Joe Germuska    { [EMAIL PROTECTED] }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
        --Sam Goody, 1956
tune in posse radio: <http://www.live365.com/stations/289268>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to