public class FopServlet
extends javax.servlet.http.HttpServlet
| Modifier and Type | Field and Description |
|---|---|
protected static String |
FO_REQUEST_PARAM
Name of the parameter used for the XSL-FO file
|
protected FopFactory |
fopFactory
The FopFactory used to create Fop instances
|
protected TransformerFactory |
transFactory
The TransformerFactory used to create Transformer instances
|
protected URIResolver |
uriResolver
URIResolver for use by this servlet
|
protected static String |
XML_REQUEST_PARAM
Name of the parameter used for the XML file
|
protected static String |
XSLT_REQUEST_PARAM
Name of the parameter used for the XSLT file
|
| Constructor and Description |
|---|
FopServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureFopFactory(FopFactoryBuilder builder)
This method is called right after the FopFactory is instantiated and can be overridden
by subclasses to perform additional configuration.
|
protected Source |
convertString2Source(String param)
Converts a String parameter to a JAXP Source object.
|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected FOUserAgent |
getFOUserAgent() |
void |
init() |
protected void |
render(Source src,
Transformer transformer,
javax.servlet.http.HttpServletResponse response)
Renders an input file (XML or XSL-FO) into a PDF file.
|
protected void |
renderFO(String fo,
javax.servlet.http.HttpServletResponse response)
Renders an XSL-FO file into a PDF file.
|
protected void |
renderXML(String xml,
String xslt,
javax.servlet.http.HttpServletResponse response)
Renders an XML file into a PDF file by applying a stylesheet
that converts the XML to XSL-FO.
|
doDelete, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceprotected static final String FO_REQUEST_PARAM
protected static final String XML_REQUEST_PARAM
protected static final String XSLT_REQUEST_PARAM
protected TransformerFactory transFactory
protected FopFactory fopFactory
protected transient URIResolver uriResolver
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void configureFopFactory(FopFactoryBuilder builder)
public void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionprotected Source convertString2Source(String param)
param - a String parameterprotected void renderFO(String fo, javax.servlet.http.HttpServletResponse response) throws FOPException, TransformerException, IOException
fo - the XSL-FO fileresponse - HTTP response objectFOPException - If an error occurs during the rendering of the
XSL-FOTransformerException - If an error occurs while parsing the input
fileIOException - In case of an I/O problemprotected void renderXML(String xml, String xslt, javax.servlet.http.HttpServletResponse response) throws FOPException, TransformerException, IOException
xml - the XML filexslt - the XSLT fileresponse - HTTP response objectFOPException - If an error occurs during the rendering of the
XSL-FOTransformerException - If an error occurs during XSL
transformationIOException - In case of an I/O problemprotected void render(Source src, Transformer transformer, javax.servlet.http.HttpServletResponse response) throws FOPException, TransformerException, IOException
src - Input XML or XSL-FOtransformer - Transformer to use for optional transformationresponse - HTTP response objectFOPException - If an error occurs during the rendering of the
XSL-FOTransformerException - If an error occurs during XSL
transformationIOException - In case of an I/O problemprotected FOUserAgent getFOUserAgent()
Copyright © 2023 Apache Software Foundation. All rights reserved.