Java, OpenOffice, Creating Getting document as jsp response as a pdf

This question already has an answer here:

  • How to serve a file with JSP? 4 answers
  • Displaying pdf in jsp 3 answers
  • How to avoid Java code in JSP files? 28 answers

  • Wow!!! Scriptlets in a jsp ... how old school!!

    Normally, you would do this in a Servlet and not aa jsp . Jsp's are usually used to respond with html, in this instance you are wanting to write binary to the response outputstream.

    You can do this in a scriptlet in your jsp

    <%
    response.getOutputStream().write(...);
    %>
    

    But I recommend you use a Servlet instead.

    Or better yet, stop using technology from 15 years ago, pick a web framework and stop using jsp's, scriptlets and servlets all together

    链接地址: http://www.djcxy.com/p/76616.html

    上一篇: 什么是Mac上JDK的路径?

    下一篇: Java,OpenOffice,将获取文档创建为jsp响应作为pdf