Display Pdf in browser using java servlet

后端 未结 2 1552
生来不讨喜
生来不讨喜 2020-11-29 10:52

I have pdf file in my application. I need to display the pdf in browser. I am reading the file as a fileInputStream, I need to display the pdf in browser with in my applica

2条回答
  •  爱一瞬间的悲伤
    2020-11-29 11:00

    In your servlet, set the MIME type to the correct one for PDF : application/pdf

    See http://www.iana.org/assignments/media-types/

提交回复
热议问题