import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import org.xml.sax.SAXException; import com.lunasil.xf.XincFormatter; import com.lunasil.xf.exceptions.XincException; /** * Feel free to use this code as a starting point for your own Servlet. * * This code is provided 'as is' with no warranty, either express or implied, of * any kind. * * I use the following URL to access this servlet when it's running on Weblogics or Tomcat: * http://localhost/XincSampleServlet/XincSampleServlet * * * You may need to use a different URL depending on your configuration. * * @author Greg Gaffney, Lunasil Ltd. */ public class XincSampleServlet extends HttpServlet { /** * Constructor for FoServlet. */ public XincSampleServlet() { super(); } public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String docName = "http://lunasil.com/samples/helloworld.fo"; String styleName = null; getServletContext().log("doGet(" + docName + ", " + styleName + ")"); if (styleName != null && styleName.length() == 0) styleName = null; try { writePdf(response, docName, styleName); } catch (Throwable e) { getServletContext().log(e.getMessage(), e); PrintWriter writer = response.getWriter(); writer.write("Error: " + e.getMessage() + "