com.jrefinery.report.ext.demo
Class JFreeReportHtmlServlet
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--com.jrefinery.report.ext.demo.JFreeReportHtmlServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class JFreeReportHtmlServlet
- extends javax.servlet.http.HttpServlet
A Sample HttpServlet to show how JFreeReports can be used to generate
PDF content in a webbased environment.
POST and GET are handled equal, so it does not
matter whether you POST or GET the URL for this servlet.
- Author:
- Thomas Morgner
- See Also:
- Serialized Form
Method Summary |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the GET method for the servlet. |
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the POST method for the request. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JFreeReportHtmlServlet
public JFreeReportHtmlServlet()
doGet
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- Handles the GET method for the servlet. The GET method is mapped to
the POST method, both commands are handled equal.
- Overrides:
doGet
in class javax.servlet.http.HttpServlet
- Parameters:
request
- the http request object.response
- the http response object.
- Throws:
javax.servlet.ServletException
- if an error occured, which could not be handled internaly.
java.io.IOException
- if writing the generated contents failed.
doPost
public void doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
- Handles the POST method for the request. This parses the report definition,
loads the tablemodel and generates a single page of the report. The generated
page is returned as StreamHtml file, with the implicit restriction, that generated
images are not included. External referenced images are included, if they are loaded
from an Http or Ftp or File source.
- Overrides:
doPost
in class javax.servlet.http.HttpServlet
- Parameters:
request
- the http request object.response
- the http response object.
- Throws:
javax.servlet.ServletException
- if an error occured, which could not be handled internaly.
java.io.IOException
- if writing the generated contents failed.