According JSP 1.1 spec, we can use HTML,DHTML, XHTML and XML tags within a JSP page. But sometimes, you may have a PDF template that you have to fill in with dynamic data. Can we include PDF templates within a JSP page?

Serge Knystautas

No, you cannot because PDF files include binary data with them, and JSPs cannot return binary data (because of how they use JspWriter instead of ServletOutputStream). To return a PDF, you'll have to use a servlet.