Help with Double Action Method
Help with Double Action Method
- Subject: Help with Double Action Method
- From: Gino Pacitti <email@hidden>
- Date: Wed, 5 Mar 2008 13:59:21 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi All
I have a component actton method that is calling a second component
(not nested) and the result is the action method being called twice
in the first component and also appendToResponse twice....
************************************************************************
*************
public AttractionVoucher downloadPDF()
{
System.out.println("GOING TO START " );
AttractionVoucher nextPage = (AttractionVoucher)pageWithName
("AttractionVoucher");
return nextPage;
}
************************************************************************
******************************
If the next page, AttractionVoucher, I am overriding
appendToResponse with this:
************************************************************************
******************************
public void appendToResponse(WOResponse r, WOContext c){
r.disableClientCaching();
r.removeHeadersForKey("Cache-Control");
r.removeHeadersForKey("pragma");
r.setHeader(mimeType, "content-type");
if (fileName != null) {
r.setHeader("inline;attachment;filename=\"" + fileName + "\"",
"content-disposition");
}
try{
NSData fileToDownload = new NSData(new File
(pdfpathfordownload));
r.setHeader(Integer.toString(fileToDownload.length()),
"content-length");
r.setContent(fileToDownload);
}catch (Exception e) {
e.printStackTrace();
}
System.out.println("These are the headers " + r.headers());
}
************************************************************************
******************************
Although the PDF is appearing it seems to call downloadPDF twice?
Has anyone an explanation or link to find out why this is happening....
This is Tiger 5.3 WO and safari...
GIno
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.7.0 (Build 1012)
Charset: US-ASCII
wj8DBQFHzqdFTKoUwFtLxjwRAprPAKCHVJQU5D1XmJCx48hOopJ6Jgm6XwCeN6IO
AlRpFhXARtx4kuXSHR/sbVI=
=81uX
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden