Integrate struts with fop

hi i successfully created a pdf file using fop in a command line. i give the xml and xsl and then automatically generates pdf. Now, i need to integrate fop with struts. i am using action but i am getting an error constructor XSLTInputHandler(String,String) is undefined. How can i solve it? thanks.
here is my code:
public class PDFServlet extends HttpServlet{
     private String xmlFile = "Report.xml";
private String xslFile = "Report.xsl";
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
// set up a FOP driver
Driver driver = new Driver();
// set up the logger for the driver
Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
driver.setLogger(logger);
try
//set the renderer to be PDF
driver.setRenderer(Driver.RENDER_PDF);
//create the input from the XSLT transform
XSLTInputHandler inputHandler = new XSLTInputHandler(xmlFile, xslFile);
// now prepare the outputStrean
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
//set the driver outputStream
driver.setOutputStream(outStream);
//do the XSLT
driver.render(inputHandler.getParser(), inputHandler.getInputSource());
//now that the content is written in the output stream,
//get ready to send the response back to browser
byte[] content = outStream.toByteArray();
httpServletResponse.setContentLength(content.length);
// set the MIME-TYPE
httpServletResponse.setContentType("application/pdf");
//write the content
httpServletResponse.getOutputStream().write(content);
httpServletResponse.getOutputStream().flush();
} catch (Exception e)
e.printStackTrace();
}

You need "import ???.???.???.XSLTInputHandler;" at the beginning of your class somewhere. Replace the question marks by the name of the package it's in, whatever that might be.

Similar Messages

  • Using Struts with Oracle Portal

    Hello,
    I am trying to run my applications developed using Struts Framework in Oracle Portal.Though Oracle Portal uses jpdk api's is there any way I can try to integrate Struts with Oracle Portal so that I can work test my application on any server and then develop portlet and run them on Oracle Portal as well?

    Check out these other discussions:
    Portletizing a struts JSP application
    Urgent: Portletizing an struts JSP application
    Similar but different detail:
    struts

  • Exception while using struts with jsf

    Hi
    Iam trying to integrate struts with jsf. when iam trying to load jsf page ...getting the following error
    Unable to initialize jsf interceptors probably due missing JSF implementation libraries
    Please help me to fix this .

    this is my web.xml
    <?xml version="1.0"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>appstruts2</display-name>
    <filter>
    <filter-name>struts2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>

  • SVG in pdf created with FOP

    Hello,
    is it possible to include SVG`s to a pdf report, which is created with FOP?
    I read something like Batik....
    Does anybody have any experiences about that?
    Thanks,
    Tim

    Thank you, CtDave, for your speedy reply and for the 'Acrobat Technical Evangelist' knowledge base article. Word 2000 is one of Microsoft's masterpieces - by disabling 'autosave', the application is totally stable, does not require 'activation' by Microsoft. Acrobat 9 enables 'saving' of interactive .pdf forms, a most valuable feature and one much appreciated by anyone completiing such forms. There must be more to this issue than 'incompatibility', because I can create a test Word 2000 document, hyperlink a valid URL, convert to .pdf with Acrobat 9, and the hyperlink works fine in Acrobat 9. When I attempt to do this using a much more complex Word 2000 document, embedded with scores of hyperlinks, these links fail to work following conversion to .pdf with Acrobat 9, but work fine following conversion to .pdf with  Acrobat 6. I can then use Acrobat 9 to open the .pdf created with Acrobat 6, and successfully edit any of these fully functional hyperlinks using the 'Link tool'. I don't know who prepared the 'Acrobat Technical Evangelist' article (AF1908DCd01) - no credits were cited, and I'm far from certain that this authentically belongs to Adobe's knowledge base. So I appreciate your sharing this information with me, but I cannot say that my question has been definitively answered. If you have any further information or tips, please reply in this thread. /rmbrown

  • Using Struts with JDeveloper, BC4J and OC4J 9.0.2

    Is it feasible to use Struts with JDeveloper 9.0.2, BC4J 9.0.2 and OC4J 9.0.2? We have an application that uses the BC4J JBO tags in version 9.0.2. We wish to use Struts and we want to retain the use of the JBO tags. Is there a way to do this without upgrading to 9.0.3?

    Here are two related questions:
    Can we upgrade to oracle9iAS 9.0.3 yet still use JDeveloper 9.0.2 and BC4J/JBO 9.0.2?
    Can we upgrade to JDeveloper 9.0.3 and BC4J/JBO 9.0.3 yet still deploy to oracle9iAS 9.0.2?

  • Steps to integrate ATG with siebel.

    What are Steps to integrate ATG with siebel?

    Refer to this thread on the same topic
    ATG Siebel Integration

  • How to Configure and Integrate EP with CRM

    Hi Everybody,
    I want to integrate EP with CRM.
    I am using SAP WAS Server.I have installed Portal.
    I downloaded CRM Business packages.
    1)How to integrate and configure in the EP with SAP R/3(CRM Module).
    2)What are the prerequisities.
    Plaese prove the exact help and documents.

    Hello,
    I think this <a href="http://help.sap.com/bp_epv260/EP_EN/documentation/EP/N12_Scen_InstallGuide_EN_US.doc">Scenario Installation Guide</a> from the <a href="http://help.sap.com/bp_epv260/EP_EN/index.htm">SAP Best Practices for Enterprise Portal V2.60</a> can help you.
    Regards
    Gregor

  • Is it possible to Integrate dos with Java to create a sample compiler?

    Is it possible to Integrate dos with Java to create a sample compiler, or do I have to write the compiler from scratch? In theory, I would like to have users enter sample code in a java text field, hit a java button that would compile/run the code, by calling a dos command prompt that would run it, and display any error messages back to the java text field. Does anyone know if this is possible? Any help would be greatly appreciated.
    Tflav23

    There is a Compiler class you might be able to use also:
    C:\jdk1.3.1_01\docs\api\java\lang\Compiler.html
    So perhaps there is no need to create a process to compile code. But I don't know if you can get information about compiler errors.

  • How to integrate DRM with third party tool for loading metadata in SQL table

    Experts,
    I am new to DRM and I have a requirement in which we want to integrate DRM with third party tool(lets say SQL table) as target and load metadata from DRM (Parent node, name , alias etc) to SQL table (same column name)
    Is there any way we can integrate DRM to export the same to table directly instead to files. If yes what are the steps we have to follow.
    Is there anyway we can customize DRM to execute queries or run batch
    Can I have a basic example please.
    Thanks in advance,
    Regards,

    1. Use DRM Export to Table option, for that create an External Connection first for the Target Database and select the respective Tables to which you wish to Export the Hierarchy information.
    2. You can perform most of the DRM Actions via the DRM_BATCH_CLIENT.exe.
        Please refer to Using the Data Relationship Management Batch Client of DRM User guide.
    let me know if you have any issues.

  • How to integrate iReceivables with third party payment system?

    Hi,
    My requirement is to integrate iReceivables with third party payment system.
    Can anyone guide me to achieve this.
    Thanks & Regards,
    Sunita

    Hello Prasad,
    <b>Connection with an External Payroll System</b>
    Payroll Outsourcing functionality allows you to compile master data or payroll data in the SAP system to submit to a third-party service provider in an electronic format. The Outsourcing solution available in the United States and Canada provides a generic interface which writes data into an IDoc (Intermediate Document) for transport to a third-party system. In order to transport data into and out of the SAP system, you must set up a logical system, partner definition, and outsourcing ports.
    If you have built your own payroll interface, using the Interface Toolbox, for example, you can use the Import section of this scenario. The Export section applies only to the transport of IDocs.
    For more information regarding outsourcing, refer to the SAP Library, Human Resources  -> PY Payroll  -> PY-US United States Payroll or PY-CA Canada Payroll  -> Outsourcing.
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/af/f4ea3444e9c47fe10000009b38f83b/frameset.htm
    Import Payroll Results from a Third-Party System
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/0a/e62481feaf11d1a5500060087832f8/frameset.htm
    regards
    Prasad
    Message was edited by:
            prasad chintala

  • Problem in IAS Server with generation of PDF with FOP and XML parsing

    Dear co.forumers :
    We are developing an application that generates a pdf document with FOP Apache utilities, and this PDf is stored in a folder of the server. Firts of all, a DDBB data is retrieved using java ( jdbc) middleware classes ( servlets ), and with these data, the pdf is generated using FOP. In these process, he data retrieved from the DDBB is converted in a XML file , and the with the XSL FOP utility, the pdf is generated.
    In the other hand, we have another application that consults data from a java beans, using a JSP, generates a XML with the data of the beans, and with this XML, and with a XSL file generates and html , with the data and fixed text.
    Both applications have been deployed as a separated WebApp in the IAS. Both use Xalan as XML parser amb Xerces is used aswell.
    So, the problem is , after generating a pdf with the firts application, every html generated via JSP-XML-XSL transformation in the second application is shown completelly bad formated. All fixed text are wrongly composed, and the text that should appear in textFields and ComboBoxes is also bad formated. The XML with the data is well generated, so the problem is in the parsing of these XML and the conversion in html through XSL. We have to re-initiate the server and then everything goes well again. If no pdf is launched, no problem occurs with the other application.
    How an a WEB APP pplication can affect to another, installed both in different folders of the IAS ? We tried to change Xalan version and FOP version, but no result.
    Is this a Poltergeist ?? and X file , maybe ?
    Has anyone had the same problem ?
    Pleae, any help will be very wellcomed.

    A PDF document may be generated in the JDeveloper OC4J server.
    http://www.oracle.com/technology/pub/notes/technote_vohra_fop.html

  • Printing with fop.war (ora-06502)

    Dear forum users,
    i need help with printing with fop comes within apex.
    I get error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    select length(dbms_xmlgen.getxml('select print_kopf.key,
    print_kopf.print_kopfid,
    print_kopf.parameter2,
    print_kopf.indexnr,
    print_kopf.logo_mimetype,
    print_kopf.formularid,
    print_kopf.formular_text,
    print_kopf.Firma_Anschrift,
    print_kopf.KL_001,
    print_kopf.KV_001,
    print_kopf.KL_002,
    print_kopf.KV_002,
    print_kopf.KL_003,
    print_kopf.KV_003,
    print_kopf.KL_004,
    print_kopf.KV_004,
    print_kopf.KL_005,
    print_kopf.KV_005,
    print_kopf.KL_006,
    print_kopf.KV_006,
    print_kopf.KL_007,
    print_kopf.KV_007,
    print_kopf.KL_008,
    print_kopf.KV_008,
    print_kopf.KL_009,
    print_kopf.KV_009,
    print_kopf.KL_010,
    print_kopf.KV_010,
    print_kopf.KL_011,
    print_kopf.KV_011,
    print_kopf.KL_012,
    print_kopf.KV_012,
    print_fuss.FL_001,
    print_fuss.FV_001,
    print_fuss.FL_002,
    print_fuss.FV_002,
    print_fuss.FL_003,
    print_fuss.FV_003,
    print_fuss.FL_004,
    print_fuss.FV_004,
    print_fuss.FL_005,
    print_fuss.FV_005,
    print_fuss.FL_006,
    print_fuss.FV_006,
    print_fuss.FL_007,
    print_fuss.FV_007,
    print_fuss.FL_008,
    print_fuss.FV_008,
    print_fuss.FL_009,
    print_fuss.FV_009,
    print_fuss.FL_010,
    print_fuss.FV_010,
    print_fuss.FL_011,
    print_fuss.FV_011,
    print_fuss.FL_012,
    print_fuss.FV_012,
    print_fuss.FL_013,
    print_fuss.FV_013,
    print_fuss.FL_014,
    print_fuss.FV_014,
    print_fuss.FL_015,
    print_fuss.FV_015,
    print_fuss.FL_016,
    print_fuss.FV_016,
    print_fuss.FL_017,
    print_fuss.FV_017,
    print_fuss.FL_018,
    print_fuss.FV_018,
    print_fuss.FL_019,
    print_fuss.FV_019,
    print_fuss.FL_020,
    print_fuss.FV_020
    from dhw.print_kopf,dhw.print_fuss
    where print_kopf.print_kopfid=print_fuss.print_kopfid
    order by print_kopf.print_kopfid,print_kopf.indexnr')) XML from dual;
    result: 7154
    I have deployed fop.war with apache tomcat. When i reduce the select, it will work.
    After searching against this error i found that the length should be lower than 32k.
    So i have tested my select with this above and the regular length is 7154.
    So, what reason throws this error ?
    Any ideas ?
    Thanks for help.
    Frank

    no not yet with Application Server.
    I have tried to compare the settings to another installation with a separeted oc4j as described in the howto. But at the moment i found no mistakes.
    If i call the url adresse like:
    http://localhost:18101/fop/apex_fop.jsp
    i get:
    500 Internal Server Error
    Servlet error: java.lang.ClassNotFoundException: fop.apex__fop
    I installed it another time with these settings:
    Web Anwendung= .../fop.war (selected war file from apex install directory)
    Anwendungsname= fop
    URL zuordnen= /fop
    I would like to know if its possible to use the fop.war out of apex install directory with the Application server? In the standalone version (as described in howto) it works. But if you install it there you don't need to define an URL.
    Is the URL /fop correct or what do i have to insert there?

  • PDF Printing with FOP 0.94

    Hi,
    are there any examples about printing apex report with FOP 0.94?
    Thanks,
    Sergio

    Hi!
    I am trying to get this solution working on a LINUX system using TOMCAT 6.0.18 rather than OC4J which we don't have a license for. I have tried both FOP 0.94 and 0.95 and seem to get similar problems. Here is the error message:
    org.apache.jasper.JasperException: An exception occurred processing JSP page /apex_fop.jsp at line 28
    25: // Setup XSLT
    26: System.setProperty("javax.xml.transform.TransformerFactory","org.apache.xalan.processor.TransformerFactoryImpl");
    27: TransformerFactory factory = TransformerFactory.newInstance();
    28: Transformer transformer = factory.newTransformer(new StreamSource(new java.io.StringReader(request.getParameter("template"))));
    29:
    30: // Set the value of a <param> in the stylesheet
    31: transformer.setParameter("versionParam", "2.0");
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    root cause
    java.lang.NullPointerException
         java.io.StringReader.<init>(StringReader.java:33)
         org.apache.jsp.apex_005ffop_jsp._jspService(apex_005ffop_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Any hints, tips, suggestions, etc. gratefully welcomed!
    Dave Venus

  • Want to integrate JavaFX with JSF

    Hi all,
    I am developing a web application in JSF. I want to integrate it with JavaFX. Is it possible to do so? If possible then how can I achieve it?
    Thanks in advance,
    JSF GEEKS

    Actually I found the same code for integrating JavaFX with JSF, which you have linked, but I show it afterwards. Anyways, thanks for your kind support.
    The other interesting thing I found is, interaction between JavaFX and JSF.
    You can interact between JavaFX and JSF like the following way.
    You just give the id in the script in which you have defined the parameters of applet to run in browser with JSF or any language like this;
    <ui:script id="js" type="text/javascript">
        javafx(
                  archive: "Your_JAR_File.jar",
                  draggable: true,
                  width: 550,
                  height: 370,
                  code: "package_name.Main",
                  name: "Name_of_Application/package_name",
    id: "myJavaFX"
        </ui:script>Then uin the header part of your page (acually in <head>), you write another script something like below;
    <script language="javascript" type="text/javascript">
    function changeColor() {
    myJavaFX.script.line1=myJavaFX.Packages.javafx.scene.paint.Color.WHITE;
    myJavaFX.script.line2=myJavaFX.Packages.javafx.scene.paint.Color.LIGHTBLUE;
    </script>Here line1+ & line2 are the variables of JavaFX script/program. So here, by this example I am changing the value of variables of JavaFX script to change the colors. myJavaFX {color:#333333} {color}is the id of the applet which I have given in the first script to generate and run the applet in browser.
    so here I give you what I understood. Hope it helps.
    Thanks,
    JSF GEEKS
    Edited by: jsfgeeks on Sep 17, 2009 10:59 AM
    Edited by: jsfgeeks on Sep 17, 2009 11:02 AM
    Edited by: jsfgeeks on Sep 17, 2009 11:03 AM
    Edited by: jsfgeeks on Sep 17, 2009 11:04 AM

  • How to integrate workflow with files?

    Hi,I know I must configurate workflow before intetgrate
    workflow with files.But ,there are some problems! when i configurate workflow ,there is no confirmation window when it finished. so when i configurate files with workflow,the system say there is no workflow scheme, so i can't integrate workflow with files.!
    anybody any idea(in detail)? thanks a lot!
    2003-7-29

    Hi,
    When workflow has been installed, it should definitely say that it was installed successfully.
    Also for WF to integrate with files successfully there are several additional languages that need to be installed.
    I have a good set of install notes for workflow. Email me at [email protected] and i will send them to you.
    Thanks and Best Regards
    Lynne

Maybe you are looking for

  • Incorrect status table E_STATUS from FM BBP_PD_CTR_GETDETAIL

    Hi, I have an SRM 4.0-implementation (SAP SRM server 5.0, Supportpack 13) in extended classic scenario. BADI u2018BBP_DOC_CHECK_BADIu2019 has been activated for filter u2018BUS2000113u2019  so I can create some custom made errormessages for the activ

  • ITunes not Syncing

    It used to work! I sync my music to my iPhone from my iMac. I Sync my contacts and calendar from my PC. My music does not update from the iMac... it used to! My contacts and appointments update properly from my PC! When I plug in and Sync with the iM

  • FaultCode:Client.Error.MessageSend faultDetail:'Channel.Connect.Failed

    Hello Everyone, I'm kinda sure a lot of people have to deal with the same error, but I can't solve it using explainations given in other topics. So here it is : I'm trying to create a Flex project on Adobe Flash Builder 4.0, using J2EE, BlazeDS and T

  • Question mark on photo

    I resized a picture in PSE7 and now it has a yellow question mark on it, it's out of focus and it's not letting me reconnect - any suggestions how to get my picture back so that I can save and print it?

  • SAP Upgrade : No Framework Program For Include

    Hi, I am getting the Syntax error as mentioned while upgrading system from 4.6C to ECC 6.0 Please provide some solution. Regards; Parag