diff options
Diffstat (limited to 'src/java/org/apache/fop/servlet')
-rw-r--r-- | src/java/org/apache/fop/servlet/FopPrintServlet.java | 18 | ||||
-rw-r--r-- | src/java/org/apache/fop/servlet/FopServlet.java | 14 | ||||
-rw-r--r-- | src/java/org/apache/fop/servlet/ServletContextURIResolver.java | 10 |
3 files changed, 21 insertions, 21 deletions
diff --git a/src/java/org/apache/fop/servlet/FopPrintServlet.java b/src/java/org/apache/fop/servlet/FopPrintServlet.java index f99468743..d446dff54 100644 --- a/src/java/org/apache/fop/servlet/FopPrintServlet.java +++ b/src/java/org/apache/fop/servlet/FopPrintServlet.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -53,31 +53,31 @@ import org.apache.fop.apps.MimeConstants; * <br/> * Example URL: http://servername/fop/servlet/FopPrintServlet?xml=data.xml&xsl=format.xsl * <br/> - * <b>Note:</b> This servlet is derived from FopServlet. Most methods are inherited from the + * <b>Note:</b> This servlet is derived from FopServlet. Most methods are inherited from the * superclass. Only the differences to the base class are necessary. - * + * * @author <a href="mailto:fop-dev@xmlgraphics.apache.org">Apache FOP Development Team</a> * @version $Id$ */ public class FopPrintServlet extends FopServlet { /** - * {@inheritDoc} + * {@inheritDoc} */ protected void render(Source src, Transformer transformer, HttpServletResponse response) throws FOPException, TransformerException, IOException { FOUserAgent foUserAgent = getFOUserAgent(); - + //Setup FOP Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, foUserAgent); - + //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); - + //Start the transformation and rendering process transformer.transform(src, res); - + //Return the result reportOK(response); } diff --git a/src/java/org/apache/fop/servlet/FopServlet.java b/src/java/org/apache/fop/servlet/FopServlet.java index 173e622dd..9b2326032 100644 --- a/src/java/org/apache/fop/servlet/FopServlet.java +++ b/src/java/org/apache/fop/servlet/FopServlet.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -85,7 +85,7 @@ public class FopServlet extends HttpServlet { /** The FopFactory used to create Fop instances */ protected FopFactory fopFactory = null; /** URIResolver for use by this servlet */ - protected URIResolver uriResolver; + protected URIResolver uriResolver; /** * {@inheritDoc} @@ -101,7 +101,7 @@ public class FopServlet extends HttpServlet { this.fopFactory.setURIResolver(this.uriResolver); configureFopFactory(); } - + /** * This method is called right after the FopFactory is instantiated and can be overridden * by subclasses to perform additional configuration. @@ -111,7 +111,7 @@ public class FopServlet extends HttpServlet { } /** - * {@inheritDoc} + * {@inheritDoc} */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { @@ -163,7 +163,7 @@ public class FopServlet extends HttpServlet { response.getOutputStream().write(content); response.getOutputStream().flush(); } - + /** * Renders an XSL-FO file into a PDF file. The PDF is written to a byte * array that is returned as the method's result. @@ -252,7 +252,7 @@ public class FopServlet extends HttpServlet { //Return the result sendPDF(out.toByteArray(), response); } - + /** @return a new FOUserAgent for FOP */ protected FOUserAgent getFOUserAgent() { FOUserAgent userAgent = fopFactory.newFOUserAgent(); diff --git a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java index 48bd2d6cb..413dac76d 100644 --- a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java +++ b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java @@ -37,9 +37,9 @@ public class ServletContextURIResolver implements URIResolver { /** The protocol name for the servlet context URIs. */ public static final String SERVLET_CONTEXT_PROTOCOL = "servlet-context:"; - + private ServletContext servletContext; - + /** * Main constructor * @param servletContext the servlet context to access the resources through @@ -47,14 +47,14 @@ public class ServletContextURIResolver implements URIResolver { public ServletContextURIResolver(ServletContext servletContext) { this.servletContext = servletContext; } - + /** {@inheritDoc} */ public Source resolve(String href, String base) throws TransformerException { if (href.startsWith(SERVLET_CONTEXT_PROTOCOL)) { return resolveServletContextURI(href.substring(SERVLET_CONTEXT_PROTOCOL.length())); } else { - if (base != null - && base.startsWith(SERVLET_CONTEXT_PROTOCOL) + if (base != null + && base.startsWith(SERVLET_CONTEXT_PROTOCOL) && (href.indexOf(':') < 0)) { String abs = base + href; return resolveServletContextURI( |