|
fop 0.90alpha1 | ||||||||||
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.apache.fop.servlet.FopServlet
Example servlet to generate a PDF from a servlet.
Servlet param is:
Field Summary | |
protected static java.lang.String |
FO_REQUEST_PARAM
Name of the parameter used for the XSL-FO file |
protected org.apache.commons.logging.impl.SimpleLog |
log
Logger to give to FOP |
protected javax.xml.transform.TransformerFactory |
transFactory
The TransformerFactory to use to create Transformer instances |
protected static java.lang.String |
XML_REQUEST_PARAM
Name of the parameter used for the XML file |
protected static java.lang.String |
XSLT_REQUEST_PARAM
Name of the parameter used for the XSLT file |
Constructor Summary | |
FopServlet()
|
Method Summary | |
protected javax.xml.transform.Source |
convertString2Source(java.lang.String param)
Converts a String parameter to a JAXP Source object. |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
void |
init()
|
protected byte[] |
render(javax.xml.transform.Source src,
javax.xml.transform.Transformer transformer)
Renders an input file (XML or XSL-FO) into a PDF file. |
protected byte[] |
renderFO(java.lang.String fo)
Renders an XSL-FO file into a PDF file. |
protected byte[] |
renderXML(java.lang.String xml,
java.lang.String xslt)
Renders an XML file into a PDF file by applying a stylesheet that converts the XML to XSL-FO. |
Methods inherited from class javax.servlet.http.HttpServlet |
doDelete, doOptions, doPost, doPut, doTrace, getLastModified, service, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String FO_REQUEST_PARAM
protected static final java.lang.String XML_REQUEST_PARAM
protected static final java.lang.String XSLT_REQUEST_PARAM
protected org.apache.commons.logging.impl.SimpleLog log
protected javax.xml.transform.TransformerFactory transFactory
Constructor Detail |
public FopServlet()
Method Detail |
public void init() throws javax.servlet.ServletException
javax.servlet.ServletException
GenericServlet.init()
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
javax.servlet.ServletException
HttpServlet.doGet(HttpServletRequest, HttpServletResponse)
protected javax.xml.transform.Source convertString2Source(java.lang.String param)
param
- a String parameter
protected byte[] renderFO(java.lang.String fo) throws FOPException, javax.xml.transform.TransformerException
fo
- the XSL-FO file
FOPException
- If an error occurs during the rendering of the
XSL-FO
javax.xml.transform.TransformerException
- If an error occurs while parsing the input
fileprotected byte[] renderXML(java.lang.String xml, java.lang.String xslt) throws FOPException, javax.xml.transform.TransformerException
xml
- the XML filexslt
- the XSLT file
FOPException
- If an error occurs during the rendering of the
XSL-FO
javax.xml.transform.TransformerException
- If an error occurs during XSL
transformationprotected byte[] render(javax.xml.transform.Source src, javax.xml.transform.Transformer transformer) throws FOPException, javax.xml.transform.TransformerException
src
- Input XML or XSL-FOtransformer
- Transformer to use for optional transformation
FOPException
- If an error occurs during the rendering of the
XSL-FO
javax.xml.transform.TransformerException
- If an error occurs during XSL
transformation
|
fop 0.90alpha1 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |