SV: set content type to text/pdf
Hi Install Acrobat Reader - That will do the trick. Currently you have no association with the .pdf extension. Hermod -Opprinnelig melding- Fra: Alex [mailto:[EMAIL PROTECTED]] Sendt: 21. juni 2002 09:37 Til: [EMAIL PROTECTED] Emne: set content type to text/pdf I have a servlet that generates pdf content. In the initData method, I use: httpservletresponse.setContentType(text/pdf); When i access the servlet from the browser (i'm using win2k), it opens a small window asking me what to do with the file (open, save, cancel..), and then, when i choose open, it asks me which application should i use to open that file (it is called Tiparire[1], because my servlet is called Tiparire), and then i choose acrobat reader. What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... Alex. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: set content type to text/pdf
Hi, I think when you make the request go to Tiparire.pdf it should open in your browser. It somehow also has something to do with the extension. Dennis. -Original Message- From: Alex [mailto:[EMAIL PROTECTED]] Sent: vrijdag 21 juni 2002 9:37 To: [EMAIL PROTECTED] Subject: set content type to text/pdf I have a servlet that generates pdf content. In the initData method, I use: httpservletresponse.setContentType(text/pdf); When i access the servlet from the browser (i'm using win2k), it opens a small window asking me what to do with the file (open, save, cancel..), and then, when i choose open, it asks me which application should i use to open that file (it is called Tiparire[1], because my servlet is called Tiparire), and then i choose acrobat reader. What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... Alex. -- 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]
Re: set content type to text/pdf
right. Mozilla and other such browsers listen to the mime type, but IE (living in a microsoft world where everything is done via file extensions) is famous for relying on the extension rather than the mime type. Liam Morley Dennis van den Berg wrote: Hi, I think when you make the request go to Tiparire.pdf it should open in your browser. It somehow also has something to do with the extension. Dennis. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: set content type to text/pdf
MS IE has sometimes his own opinion what to open and ignores the content type. The safest way to convince IE to open PDF is to set the content type to load the file from a url that has the extension .pdf. Additional hint: Make shure that your servlet supports Byte range requests (HTTP 1.1). The acrobat reader sometimes uses this. (Have a look at the source for the servlet that implements the fileserving for tomcat) -Ursprüngliche Nachricht- Von: Alex [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 21. Juni 2002 09:37 An: [EMAIL PROTECTED] Betreff: set content type to text/pdf What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: set content type to text/pdf
Sorry a little typo: The safest way to convince IE to open PDF is to set the content type and to load the file from a url that has the ^ extension .pdf. -Ursprüngliche Nachricht- Von: Ralph Einfeldt Gesendet: Freitag, 21. Juni 2002 09:44 An: Tomcat Users List Betreff: AW: set content type to text/pdf The safest way to convince IE to open PDF is to set the content type to load the file from a url that has the extension .pdf. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: set content type to text/pdf
Hello Ralph, I can't point my browser to a location that ends with .pdf, because i have to point it to my servlet, for ex: document.location.href=/servlet/Tiparire Is there any trick to do this ? Alex. Friday, June 21, 2002, 10:44:00 AM, you wrote: RE MS IE has sometimes his own opinion what to open and RE ignores the content type. RE The safest way to convince IE to open PDF is to set the RE content type to load the file from a url that has the RE extension .pdf. RE Additional hint: RE Make shure that your servlet supports Byte range RE requests (HTTP 1.1). The acrobat reader sometimes RE uses this. (Have a look at the source for the RE servlet that implements the fileserving for tomcat) -Ursprüngliche Nachricht- Von: Alex [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 21. Juni 2002 09:37 An: [EMAIL PROTECTED] Betreff: set content type to text/pdf What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... RE -- RE To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] RE For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: set content type to text/pdf
I'm sure there's a better way, but in case there's not, there's always mod_rewrite. You could rewrite the url so that /(*).pdf goes to /$1. Liam Morley Alex wrote: Hello Ralph, I can't point my browser to a location that ends with .pdf, because i have to point it to my servlet, for ex: document.location.href=/servlet/Tiparire Is there any trick to do this ? Alex. Friday, June 21, 2002, 10:44:00 AM, you wrote: RE MS IE has sometimes his own opinion what to open and RE ignores the content type. RE The safest way to convince IE to open PDF is to set the RE content type to load the file from a url that has the RE extension .pdf. RE Additional hint: RE Make shure that your servlet supports Byte range RE requests (HTTP 1.1). The acrobat reader sometimes RE uses this. (Have a look at the source for the RE servlet that implements the fileserving for tomcat) -Ursprüngliche Nachricht- Von: Alex [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 21. Juni 2002 09:37 An: [EMAIL PROTECTED] Betreff: set content type to text/pdf What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... RE -- RE To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] RE 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]
RE: AW: set content type to text/pdf
You could also map your servlet to the pattern *.pdf Dennis. -Original Message- From: Liam Morley [mailto:[EMAIL PROTECTED]] Sent: vrijdag 21 juni 2002 9:57 To: Tomcat Users List Subject: Re: AW: set content type to text/pdf I'm sure there's a better way, but in case there's not, there's always mod_rewrite. You could rewrite the url so that /(*).pdf goes to /$1. Liam Morley Alex wrote: Hello Ralph, I can't point my browser to a location that ends with .pdf, because i have to point it to my servlet, for ex: document.location.href=/servlet/Tiparire Is there any trick to do this ? Alex. Friday, June 21, 2002, 10:44:00 AM, you wrote: RE MS IE has sometimes his own opinion what to open and RE ignores the content type. RE The safest way to convince IE to open PDF is to set the RE content type to load the file from a url that has the RE extension .pdf. RE Additional hint: RE Make shure that your servlet supports Byte range RE requests (HTTP 1.1). The acrobat reader sometimes RE uses this. (Have a look at the source for the RE servlet that implements the fileserving for tomcat) -Ursprüngliche Nachricht- Von: Alex [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 21. Juni 2002 09:37 An: [EMAIL PROTECTED] Betreff: set content type to text/pdf What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... RE -- RE To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] RE 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]
AW: AW: set content type to text/pdf
It's possible to configure tomcat to let you request /servlet/Tiparire/text.pdf and to get /servlet/Tiparire executed. I haven't tried by now to do something like that so can't give you much more help. Maybe something like this should do the trick: servlet-mapping servlet-nameTiparire/servlet-name url-pattern*.pdf/url-pattern /servlet-mapping -Ursprüngliche Nachricht- Von: Alex [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 21. Juni 2002 09:57 An: Tomcat Users List Betreff: Re: AW: set content type to text/pdf I can't point my browser to a location that ends with .pdf, because i have to point it to my servlet, for ex: document.location.href=/servlet/Tiparire Is there any trick to do this ? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: AW: set content type to text/pdf
Hello Ralph, I've modified web.xml from ROOT\WEB-INF, and i've added something like this: servlet-mapping servlet-nameTiparire/servlet-name url-patternTiparire.pdf/url-pattern /servlet-mapping My servlet is called Tiparire.class and is located into ROOT\WEB-INF\classes But, when i start tomcat, it says: ERROR reading java.io.ByteArrayInputStream@4e280c At Line 11 /web-app/servlet-mapping/ What is wrong ? Alex. Friday, June 21, 2002, 11:01:10 AM, you wrote: RE It's possible to configure tomcat to let you request RE /servlet/Tiparire/text.pdf and to get /servlet/Tiparire RE executed. I haven't tried by now to do something like RE that so can't give you much more help. RE Maybe something like this should do the trick: RE servlet-mapping RE servlet-nameTiparire/servlet-name RE url-pattern*.pdf/url-pattern RE /servlet-mapping -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
AW: AW: AW: set content type to text/pdf
This was posted some hours ago to an error that looks similar to yours: This error is caused by a problem in the web.xml file and the full error can be seen in the webapp loader log files. If you have not overridden this with a Logger tag, then the file will be named catalina_somedate.log in your CATALINA_HOME/logs folder. That error will tell you exactly what is going wrong. Best Regards, Neale Rudd metawerx http://www.metawerx.net -Ursprüngliche Nachricht- Von: Alex [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 21. Juni 2002 10:29 An: Tomcat Users List Betreff: Re: AW: AW: set content type to text/pdf But, when i start tomcat, it says: ERROR reading java.io.ByteArrayInputStream@4e280c At Line 11 /web-app/servlet-mapping/ What is wrong ? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: AW: AW: set content type to text/pdf
You might need to declare the servlet from within a servlet element like this as well: |servlet-mapping servlet-nameTiparire/servlet-name url-patternTiparire.pdf/url-pattern /servlet-mapping servlet servlet-nameTiparire/servlet-name servlet-classTiparire/servlet-class /servlet | servlet-class is actually the fully qualified class name (with package name etc), just in case it's part of a package. Liam Morley Alex wrote: Hello Ralph, I've modified web.xml from ROOT\WEB-INF, and i've added something like this: servlet-mapping servlet-nameTiparire/servlet-name url-patternTiparire.pdf/url-pattern /servlet-mapping My servlet is called Tiparire.class and is located into ROOT\WEB-INF\classes But, when i start tomcat, it says: ERROR reading java.io.ByteArrayInputStream@4e280c At Line 11 /web-app/servlet-mapping/ What is wrong ? Alex. Friday, June 21, 2002, 11:01:10 AM, you wrote: RE It's possible to configure tomcat to let you request RE /servlet/Tiparire/text.pdf and to get /servlet/Tiparire RE executed. I haven't tried by now to do something like RE that so can't give you much more help. RE Maybe something like this should do the trick: RE servlet-mapping RE servlet-nameTiparire/servlet-name RE url-pattern*.pdf/url-pattern RE /servlet-mapping -- 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]
Re[2]: AW: AW: set content type to text/pdf
Hello Liam, I've inserted into the web.xml file these lines: servlet-mapping servlet-nameTiparire/servlet-name url-patternTiparire.pdf/url-pattern /servlet-mapping servlet servlet-nameTiparire/servlet-name servlet-classTiparire/servlet-class /servlet Tiparire.class is not part of any package. Tomcat starts ok, but, when i'm trying to access the location servlet/Tiparire.pdf, it says: The requested resource (/servlet/Tiparire.pdf) is not available Where is the problem ? Alex. Friday, June 21, 2002, 11:56:32 AM, you wrote: LM You might need to declare the servlet from within a servlet element like LM this as well: LM |servlet-mapping LM servlet-nameTiparire/servlet-name LM url-patternTiparire.pdf/url-pattern LM /servlet-mapping LM servlet LM servlet-nameTiparire/servlet-name LM servlet-classTiparire/servlet-class LM /servlet LM | LM servlet-class is actually the fully qualified class name (with package LM name etc), just in case it's part of a package. LM Liam Morley LM Alex wrote: Hello Ralph, I've modified web.xml from ROOT\WEB-INF, and i've added something like this: servlet-mapping servlet-nameTiparire/servlet-name url-patternTiparire.pdf/url-pattern /servlet-mapping My servlet is called Tiparire.class and is located into ROOT\WEB-INF\classes But, when i start tomcat, it says: ERROR reading java.io.ByteArrayInputStream@4e280c At Line 11 /web-app/servlet-mapping/ What is wrong ? Alex. Friday, June 21, 2002, 11:01:10 AM, you wrote: RE It's possible to configure tomcat to let you request RE /servlet/Tiparire/text.pdf and to get /servlet/Tiparire RE executed. I haven't tried by now to do something like RE that so can't give you much more help. RE Maybe something like this should do the trick: RE servlet-mapping RE servlet-nameTiparire/servlet-name RE url-pattern*.pdf/url-pattern RE /servlet-mapping -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Re[2]: AW: AW: set content type to text/pdf
Freitag, 21. Juni 2002 11:10 schrieb Alex: Tiparire.class is not part of any package. Tomcat starts ok, but, when i'm trying to access the location servlet/Tiparire.pdf, it says: Hi, cause your using a servlet Mapping and your servlet is in the ROOT Context you have to leave the servlet in servlet/Tiparire.pdf away You should reach your servlet by connecting to this URL http://yourserver:8080/Tiparire.pdf Cu -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: set content type to text/pdf
Alex, Instead of httpservletresponse.setContentType(text/pdf); try httpservletresponse.setContentType(application/pdf); Jim Urban - [EMAIL PROTECTED] Park City Solutions Inc. Clinical Connectivity Suite Product Manager Suite 295 500 Park Blvd. Itasca, IL 60143 Voice: (630) 250-3045 x106 Fax: (630) 250-3046 CONFIDENTIALITY NOTICE This message and any included attachments are from Park City Solutions Inc. and are intended only for the entity to which it is addressed. The contained information is confidential and privileged material. If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited and may be unlawful. If you have received this communication in error please notify the sender of the delivery error by e-mail or call Park City Solutions Inc. corporate offices at (435) 654-0621 -Original Message- From: Alex [mailto:[EMAIL PROTECTED]] Sent: Friday, June 21, 2002 2:37 AM To: [EMAIL PROTECTED] Subject: set content type to text/pdf I have a servlet that generates pdf content. In the initData method, I use: httpservletresponse.setContentType(text/pdf); When i access the servlet from the browser (i'm using win2k), it opens a small window asking me what to do with the file (open, save, cancel..), and then, when i choose open, it asks me which application should i use to open that file (it is called Tiparire[1], because my servlet is called Tiparire), and then i choose acrobat reader. What can i do so my browser automatically opens the pdf content generated by the servlet ? Thanks in advance... Alex. -- 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]
Re: AW: AW: set content type to text/pdf
Digging back into the dark cavern that is trying to get IE to work with a spec complying application (from which I have emerged and no longer care about)... I believe you might be able to go http://server:8080/servlet/pdfservlet?thisisnotanarg.pdf This may confuse IE into giving you what it should have given you in the first place. I also vaguely recall that IE is VERY particular about the headers that you send... the following are headers that I sent out of an app I was using with PDF. Worth trying, but not worth relying on! response.addHeader( Content-Type, application/pdf; name= + (char) 34 + outfilename + (char) 34); response.addHeader( Content-Disposition, inline; filename= + (char) 34 + outfilename + (char) 34); Enjoy! (Don't question the use of (char) 34, I borrowed it from elsewhere without thinking!) Now when someone can explain why IE displays PNG with a different color than what they really are (no alpha channels or anything silly like that), then I'll be happy. Well... no I won't, but I might be bemused! Constantin Wolber wrote: Freitag, 21. Juni 2002 11:10 schrieb Alex: Tiparire.class is not part of any package. Tomcat starts ok, but, when i'm trying to access the location servlet/Tiparire.pdf, it says: Hi, cause your using a servlet Mapping and your servlet is in the ROOT Context you have to leave the servlet in servlet/Tiparire.pdf away You should reach your servlet by connecting to this URL http://yourserver:8080/Tiparire.pdf Cu -- 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]