com.jrefinery.report.ext.demo
Class JFreeReportServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.jrefinery.report.ext.demo.JFreeReportServlet
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
- public class JFreeReportServlet
- extends javax.servlet.http.HttpServlet
A Sample HttpServlet to show how JFreeReports can be used in a
web based environment. POST and GET are handled equal, so it does not
matter whether you POST or GET the URL for this servlet.
- Author:
- Jeevan Sunkersett
- 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 |
JFreeReportServlet
public JFreeReportServlet()
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.
- 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 PDF file.
- 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.