Could you attach your servlet and html source? I have a link mapped to a
servlet and it doesn't get called twice by either browser. (Although I
haven't tested with IE 4.0 yet). 

Unless you're talking about the strange behavior you get from IE when you
use:
      response.setHeader("Content-Disposition", "attachment;
filename=ReportOutput.pdf");

Their are two advantages to this method. (1) You can set the PDF filename on
the fly (IE - include a date or some kind of user or session specific ID)
without having to have a servlet mapping involved in the filename. (2) You
avoid the PDF-browser-plugin and give people the standard Open/Save file
dialog they are used to for most downloads. 

But for some reason IE likes to present the Open/Save dialog twice. Which is
obviously too annoying/confusing to end users to be part of any final
soltuion. That's not by any chance what you're talking about when you
mention the servlet being loaded twice is it? After a few hours of hassle I
think I figured out why IE does what it does. But it's probably not worth
going into because I don't think there's a cure. Also "Content-Disposition"
is explicitly not supported in the latest HTTP spec so it's probably best
not to count on it.

Currently I'm thinking my final end-user solutuion will consist of two
parts: 

(1) Having the PDF-generator servlet accessed by a form submit which is
actually a link--using onClick='this.form.submit()'. That way savvy users
can right-click and select "Save Link(/Target) As". I can't just make it a
straight link because I need data from the form to generate the PDF. (I
haven't fully tested this idea yet). 

(2) A little link that explains how to disable PDF-browser-integration for
users like me who find it annoying.

Hope someone finds this useful!

-Matt

 




> -----Original Message-----
> From: Beer, Christian [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 09, 2001 6:10 AM
> To: '[EMAIL PROTECTED]'
> Subject: AW: Servlet called twice
> 
> 
> Try using Netscape instead of IE! :-)
> 
> -----Ursprüngliche Nachricht-----
> Von: Smith, Paul R [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 9. Oktober 2001 12:40
> An: '[EMAIL PROTECTED]'
> Betreff: RE: Servlet called twice
> 
> 
> I have _exactly_ the same problem. Nothing I have tried has worked.
> 
> Please help
> 
> - Paul Smith
> 
> -----Original Message-----
> From: Kuehnberger [mailto:[EMAIL PROTECTED]]
> Sent: 09 October 2001 09:52
> To: [EMAIL PROTECTED]
> Subject: Servlet called twice
> 
> 
> Hi,
> 
> My servlet can produce html or pdf, depending on a parameter which is
> passed.
> I read the discussion about that problem, but whatever I tried my
> servlet is still called twice when the output is pdf,
> if the out output is html the servlet is invoked just once.
> 
> If someone can please help me with that
> 
> Jens
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to