|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.faceless.util.HttpProxyServlet
org.faceless.report.PDFProxyServlet
public abstract class PDFProxyServlet
The PDFProxyServlet is a basic servlet which accepts a request,
reads an XML report from another URL and turns it into a PDF to be
returned to the client. Those using the Servlet 2.3 architecture may
want to consider using the PDFFilter
class instead.
Most overriders should be able to just override the getProxyURL() method, to alter where the report XML is kept.
Meta tags that aren't already known to the Report Generator and that begin with "HTTP-" are added to the response header (minus the "HTTP-" prefix). An example would be to place <meta name="HTTP-Expires" value="Mon, 01 Jan 1999 12:00:00 GMT"> in the head of the XML, which would set the "Expires" header in the HTTP response.
The following custom Meta-Tags may also be used to control the behaviour of the servlet.
This class also implements org.xml.sax.ErrorHandler, to deal with any errors found during the XML parsing process. Currently all warnings and errors are fatal, and logged to System.err.
Constructor Summary | |
---|---|
PDFProxyServlet()
|
Method Summary | |
---|---|
void |
error(SAXParseException exception)
|
void |
fatalError(SAXParseException exception)
|
abstract String |
getProxyURL(HttpServletRequest request,
HttpServletResponse response)
Returns the absolute URL to send the proxy request to. |
org.faceless.util.HttpRequestWriter |
getRequest(org.faceless.util.HttpRequestReader request,
HttpServletResponse response)
Implements the getRequest method of the generic HttpProxyServlet. |
org.faceless.util.HttpResponseWriter |
getResponse(org.faceless.util.HttpResponseReader in)
Implements the getResponse method of the generic HttpProxyServlet. |
void |
init()
|
void |
initParser(ReportParser parser)
Set any initialization options for the parser, if necessary. |
void |
metaTag(org.faceless.util.HttpResponseReader reader,
org.faceless.util.HttpResponseWriter writer,
String name,
String value)
Handle any meta tags that aren't recognised by the core Report Generator. |
void |
modifyPDF(PDF pdf)
Adjust the PDF after it's been created but before it's rendered back to the browser. |
void |
warning(SAXParseException exception)
|
Methods inherited from class org.faceless.util.HttpProxyServlet |
---|
doGet, doPost |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
service |
Methods inherited from class javax.servlet.GenericServlet |
---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDFProxyServlet()
Method Detail |
---|
public void init() throws ServletException
init
in class org.faceless.util.HttpProxyServlet
ServletException
public org.faceless.util.HttpRequestWriter getRequest(org.faceless.util.HttpRequestReader request, HttpServletResponse response) throws ServletException, IOException
getRequest
in class org.faceless.util.HttpProxyServlet
request
- the incoming request to this proxyresponse
- the outgoing response. Should only be written to if this method
is returning null due to an error.
ServletException
IOException
public org.faceless.util.HttpResponseWriter getResponse(org.faceless.util.HttpResponseReader in) throws ServletException, IOException
getResponse
in class org.faceless.util.HttpProxyServlet
in
- the response from the request specified by getRequest()
ServletException
IOException
public void metaTag(org.faceless.util.HttpResponseReader reader, org.faceless.util.HttpResponseWriter writer, String name, String value) throws ServletException, IOException
request
- the Servlet requestresponse
- the Servlet requestname
- the "name" attribute from the meta tagvalue
- the "value" attribute from the meta tag
ServletException
IOException
public void warning(SAXParseException exception) throws SAXException
warning
in interface ErrorHandler
SAXException
public void error(SAXParseException exception) throws SAXException
error
in interface ErrorHandler
SAXException
public void fatalError(SAXParseException exception) throws SAXException
fatalError
in interface ErrorHandler
SAXException
public void initParser(ReportParser parser)
public void modifyPDF(PDF pdf)
public abstract String getProxyURL(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
Returns the absolute URL to send the proxy request to. This method is the only method that needs to be overriden by concrete subclasses of this class.
If no valid URL can be constructed due to an incorrect request, this method should return null and an appropriate error written to the response.
request
- the incoming request from the clientresponse
- the outgoing response to the client - should only be written
to if an error has occurred and the method is returning null
IOException
ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |