How to offer download of local PDF file in Java?

前端 未结 3 1544
旧巷少年郎
旧巷少年郎 2021-01-16 11:37

I have JBoss running as application server and somewhere on my HD there is a PDF file, that gets created when the user clicks on a specific action. Let\'s say the file is he

3条回答
  •  青春惊慌失措
    2021-01-16 11:40

    You can simply write a servlet wich read the pdf and write it to the response output stream.

    Exemple here : http://www.java-forums.org/blogs/servlet/668-how-write-servlet-sends-file-user-download.html

提交回复
热议问题