public class ReportServlet
extends javax.servlet.http.HttpServlet
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUFFER_SIZE
The buffer size to hold responses
|
private static CentralLogger |
LOG
Logger.
|
private static int |
MAX_BUFFER_MEMORY_BYTES
Max memory in bytes for the buffer writing to the temp merged pdf file.
|
| Constructor and Description |
|---|
ReportServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Handles HTTP GET requests to build reports.
|
private void |
writeDocument(java.io.InputStream inputStream,
int contentLength,
DocumentType docType,
java.lang.String fileName,
javax.servlet.http.HttpServletResponse resp,
boolean printAction)
Writes the document in the http output stream preserving its content type.
|
private void |
writeMergedDocuments(ReportBuilder.Document doc,
javax.servlet.http.HttpServletResponse resp,
boolean printAction)
Writes split content of the target document in a one merged pdf file.
|
private void |
writeOriginalDocument(ReportBuilder.Document doc,
javax.servlet.http.HttpServletResponse resp,
boolean printAction)
Writes the target document in the http output stream preserving its content type.
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceprivate static final int BUFFER_SIZE
private static final CentralLogger LOG
private static final int MAX_BUFFER_MEMORY_BYTES
protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws java.io.IOException
doGet in class javax.servlet.http.HttpServletreq - The http requestresp - The http responsejava.io.IOExceptionprivate void writeOriginalDocument(ReportBuilder.Document doc, javax.servlet.http.HttpServletResponse resp, boolean printAction) throws java.io.IOException
doc - The target documentresp - Provides output streamprintAction - The true value indicates a print request, otherwise a download file request.java.io.IOException - The exception if there is a failed output operation.private void writeMergedDocuments(ReportBuilder.Document doc, javax.servlet.http.HttpServletResponse resp, boolean printAction) throws java.io.IOException
doc - The document with split contentresp - Provides output streamprintAction - The true value indicates a print request, otherwise a download file request.java.io.IOException - The exception if there is a failed output operation.private void writeDocument(java.io.InputStream inputStream,
int contentLength,
DocumentType docType,
java.lang.String fileName,
javax.servlet.http.HttpServletResponse resp,
boolean printAction)
throws java.io.IOException
inputStream - The input stream of the document.contentLength - The length of the content in the input stream.docType - The document type.fileName - The name of the file to be written.resp - The http response.printAction - The true value indicates a print request, otherwise a download file request.java.io.IOException - The exception if there is a failed output operation.