Download pdf inside the adf region question

All,

I am trying to download a PDF within a region. Is my code to download
        InputStream ios = Thread.currentThread().getContextClassLoader().getResourceAsStream("StatementReport.jrxml");
        Map parameters = new HashMap();
        parameters.put("PAR_CUSTOMER_ID", customerId.toString());
        parameters.put("SUBREPORT_DIR", "./");
        parameters.put("rowid", statementRowId.toString());
        Connection connection = null;
        try {
            HttpServletResponse response =  (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
            ServletOutputStream servletOutputStream;
            servletOutputStream = response.getOutputStream();
            byte[] bytes = null;
            //this will give us the existing connection from the AM
            ob = bc.getOperationBinding("getCurrentConnection");
            ob.execute();
            connection = (Connection)ob.getResult();
            //This will create a new connection alltogether.
            /* Context ctx = new InitialContext();
            Context envCtx = (Context)ctx.lookup("");
            DataSource ds = (DataSource)envCtx.lookup("jdbc/om");
            if (ds != null) {
                    connection = ds.getConnection();
            }  */
            JasperDesign jasperDesign = JRXmlLoader.load(ios);
            JasperReport jasperReport =   JasperCompileManager.compileReport(jasperDesign);
            bytes = JasperRunManager.runReportToPdf(jasperReport, parameters,  connection);
            response.addHeader("Content-disposition",  "attachment;filename=statement.pdf");
            response.setContentType("application/pdf");
            response.setContentLength(bytes.length); //commented this also as mentioned in a number of post. Also tried adding buffersize to the response object but no progress
            servletOutputStream.write(bytes, 0, bytes.length);
            servletOutputStream.flush();
            servletOutputStream.close();
            context.responseComplete();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (JRException e) {
            e.printStackTrace();
        } /*catch (NamingException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        } */catch(Exception e){
            e.printStackTrace();
        }
I get the following error and her dosent open pdf

< Sep 28, 2011 10:12:04 GST > < error > < HTTP > < BEA-101104 > < Servlet running in the servlet context "[path of the module: DealerOnline ServletContext@8594227[app:DealerOnline: / DealerOnline spec-version: 2.5 version: V2.0]" failed, java.net.ProtocolException: did not said Content-Length, wrote: '0' bytes instead of a said: '325047' bytes...
java.net.ProtocolException: did not said Content-Length, wrote: '0' bytes instead of a stated: '325047' bytes.
at weblogic.servlet.internal.ServletOutputStreamImpl.ensureContentLength(ServletOutputStreamImpl.java:446)
at weblogic.servlet.internal.ServletResponseImpl.ensureContentLength(ServletResponseImpl.java:1432)
at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:1511)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1462)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
Truncated. check the log file full stacktrace
>

I tried on all browsers, but the error persists


thnks
11.1.1.5 Jdev

Hello

Do you use the fileDownloadActionListener - http://download.oracle.com/docs/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_fileDownloadActionListener.html? Otherwise I try

Frank

Tags: Java

Similar Questions

  • TemplateBeginEditable tag inside the editable region

    I bought a HTML template several years and it works fine until I updated for Dreamweaver on creative cloud. I can still update the pages, but now I can't update a page template. I get the following error whenever I try to update a page template:

    There is an error on line 49, column 47 (absolute position 2839) of (Template:main.dwt) TemplateBeginEditable tag inside the editable region

    My temporary solution was to go back to an older version of Dreamweaver (CS5) on an old Mac to make updates to the model. But I would like to solve this problem, so I can make changes in CC model.

    Here is the code to the top of the site, including the line 49 (I replaced some content meta here with "xyz")
    FYI: line 49 is: <!-TemplateBeginEditable name = "head"->

    <! DOCTYPE html >

    < head >

    < meta http-equiv = "Content-Type" content = text/html"; Charset = UTF-8 "/ >"

    < meta http-equiv = "X-UA-Compatible" content = "IE = edge, chrome = 1" >

    < meta name = "viewport" content = "width = device-width, original scale = 1.0" >

    <!-< META HTTP-EQUIV = "refresh" CONTENT = "15" > - >

    < meta name = "author" content = "xyz" >

    "< link rel ="shortcut icon"href ="... / favicon.ico ">"

    "" < link rel = "image_src" href = "... / img/logos/Lc_ZAR_dot_FE4F00_B8BABC.jpg" / >

    <!-* fonts Google / /-->

    < link href =' http://fonts.googleapis.com/CSS?family=Raleway:400,100,200,300,500,600,700,800 ' rel = "stylesheet" type = "text/css" >

    < link href =' http://fonts.googleapis.com/css?family=Lato:100, 300, 400, 700, 900, 100italic, 300italic, 400ita lic, 700italic, 900italic ' rel = "stylesheet" type = "text/css" >

    < link href =' http://fonts.googleapis.com/css?family=Open+Sans:400, 300, 300italic, 400italic, 600, 600italic, 700italic ' rel = "stylesheet" type = "text/css" >

    < link href =' http://fonts.googleapis.com/CSS?family=open+sans+condensed:300, 300italic, 700 ' rel = "stylesheet" type = "text/css" >

    <! - core bootstrap CSS - >

    "" < link href = "... / css/bootstrap.min.css" rel = "stylesheet" type = "text/css" >

    <!-Custom-> CSS

    "" < link href = "... / css/animate.css" rel = "stylesheet" type = "text/css" >

    "" < link href = "... / css/jquery.mCustomScrollbar.css" rel = "stylesheet" type = "text/css" >

    "" < link href = "... / css/font-awesome/css/font-awesome.min.css" rel = "stylesheet" type = "text/css" >

    "" < link rel = "stylesheet" href = "... / css/colorbox-skins/4/colorbox.css" type = "text/css" >

    "" < link href = "... / css/main.css ' rel ="stylesheet"type =" text/css">

    "" < link href = "... / css/header/h1.css" rel = "stylesheet" type = "text/css" >

    "" < link href = "... / css/responsive.css" rel = "stylesheet" type = "text/css" >

    "" < link href = "... / css/color1.css" rel = "stylesheet" type = "text/css" id = 'site-color' >

    "" < link href = "... / css/rivathemes.css" rel = "stylesheet" type = "text/css" >

    <! - LayerSlider styles - >

    "" < link rel = "stylesheet" href = "... / css/layerslider/css/layerslider.css" type = "text/css" >

    <!-only for debugging purposes. Do not copy this line really! ->

    "<!-[if lt IE 9] > < script src="js/vendor/ie8-responsive-file-warning.js "> < / script > <! [endif]-->

    <! - HTML5 shim and Respond.js IE8 takes in charge of HTML5 elements and questions from the media - >

    <!-[if lt IE 9] >

    " < script src =" https://OSS.MaxCDN.com/libs/html5shiv/3.7.0/html5shiv.js "> < / script > .

    " < script src =" https://OSS.MaxCDN.com/libs/respond.js/1.4.2/respond.min.js "> < / script > .

    <! [endif]-->

    "< script src ="... / js/vendor/modernizr-2.6.2-respond-1.1.0.min.js "> < / script >"

    "< script src ="... / js/twitterFetcher_v10_min.js "> < / script >"

    < script type = "text/javascript" >

    <!--

    function MM_openBrWindow (theURL, winName, features) {//v2.0

    Window.Open (Theurl, winName, Features);

    }

    ->

    < /script >

    <!-TemplateBeginEditable name = "head"->

    < meta content = "description" name = "xyz" >

    < meta name = "keywords" content = "xyz" >

    XYZ < title > < /title >

    <! - TemplateEndEditable - >

    < script >

    (function(i,s,o,g,r,a,m) {I ['GoogleAnalyticsObject'] = r; i [r] = [r] i: function() {}})

    (.q i [r] = [r] i .q |) ([]) .push (arguments)}, l i [r] = 1 * new Date (); a = s.createElement (o),

    m = s.GetElementsByTagName (o) [0]; a.Async = 1; a.SRC = g; m.parentNode.InsertBefore (a, m)

    ({ }) (window, document, 'script','https://www.google-analytics.com/analytics.js', 'ga');

    GA ('create', ' UA-79018338-1 "," auto");

    GA ('send', 'consultation');

    < /script >

    < / head

    I wonder if this is related to the code Linting.  Maybe if you disable the Linting in preferences DW will leave an error appears when there seems to be none.

    Otherwise, try to restore preferences-

    Unusual behavior in Dreamweaver? Restore preferences.

    Or continue to use the previous version of DW with this model.

    Nancy O.

  • Model Dreamweaver, renounce the error 'instancebegineditable tag inside the editable region.

    I searched the internet and no matter what forum I can find about Dreamweaver and find the solutions that they don't did not help me, but there was a problem of command for many people. I created a template by following the steps via a tutorial from helpvid.net and the website looked very good to be pretty basic but since last night when I try save the model gives the error message "there is an error in line 8, column 47 (absolute position 789) of 'address of the file': InstanceBeginEditable tag inside the editable region.» Now from what I have read on the forums that means usually there is a spelling error or something placed inside the area when should not be, but there are only 50 odd lines on it and can't see any problem. When I view the files it gives error on, replicas of the editable 'start' there are has a number of times, but they shouldn't be there because they are not on the model. IM also conclusive that until this error came pages went well when downloaded, but now the footer height that has been set to 20px is 200px when downloaded and I check all coding for it so the Divs see but still no error. I downloaded my tempalete and some of the pages that mistakes about donations to see if that help, do not know if its better just stick wall of coding so sick message links to the files and if the code must be pasted here ill do it. http://dublinmoulding.com/ <-work im site, one can see the footer is very large. Should be 20px height but inspect element shows his 200px - #wrapper #footer {color: #FFF;}     height: 200px; The model is #wrapper #footer {color: #FFF;}     text-align: center;     margin: 0px;     do-size: 18px;     make-style: normal;     make-weight: lighter;     do-family: Arial, Helvetica, without serif.     padding-top: 5px;     padding-right: 0px;     padding-bottom: 5px;     padding-left: 0px;     height: 20px; http://dublinmoulding.com/dreamweaver/temp1.dwt <-my error tempalate is abandoned on pages created by using the template


    * Update * I've edited file names of some of the pages I used the template on so now it shows as coding.


    http://dublinmoulding.com/Dreamweaver/index.html6 <-my index page

    http://dublinmoulding.com/Dreamweaver/about.html6 <-on the page

    I've recreated the model and its not waive errors and the layout seems well, hurt that mark as resolved thank you for help

  • Label 'for' attribute does not not as expected inside the af: region

    Hello

    I use JDeveloper 11.1.1.6.

    When 'for' attribute of af: outputLabel outdoor af:region is specified, the corresponding component (for example, af:inputText) focuses by clicking on the label.
    However, when af:outputLabel is inside the af: region, the corresponding component does not.

    It is likely that this is due to "0:" inserted into the components within af customer id: region.

    Here is an example of code jsff (which must be inserted to jspx as a region)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
              <af:group id="group">
      <af:outputLabel value="Label inside af:region" id="ol1" for="it1"/>
      <af:inputText simple="true" id="it1"/>
      <af:outputLabel value="Label inside af:region (with '0:' added to its for attribute)" id="ol2" for="0:it2"/>
      <af:inputText simple="true" id="it2"/>
      </af:group>
    </jsp:root>
    On HTML source, "0:" is inserted into the components customer id (for example, if the id in the region is "r1", the inputText "it1" customer id is "r1:0:it1"), although not in the attributes 'for' the components of the label.
    Accordingly, the "it1" inputText does not focus when you click on the label to 'ol1', but the inputText "it2" is when you click on the label of 'ol2.

    How can I make the "for" attribute work properly inside the af: region?

    Kind regards
    Kenji

    Hi Kenji,

    You can use instead, , it works as expected.

    AP

  • I can't download PDFs from the internet because of an error on iexplore.exe running. How can I fix it?

    I have an error of execution on the iexplore.exe file.  The message is "the application requested execution to terminate in an unusual way.  I can't open download PDFs from the internet because of this.  How can I fix it?

    I have an error of execution on the iexplore.exe file.  The message is "the application requested execution to terminate in an unusual way.  I can't open download PDFs from the internet because of this.  How can I fix it?

    Use another browser.

    You try to view in the browser or that you get the same reaction if you right click and save the PDF file and open it directly.  If the work of the latter, uninstall your pdf reader, restart and reinstall the latest version.

  • access to the content of the files downloaded from the internet: when I download PDFs from the internet to my documents, they get there but does not open

    When I download PDFs from the internet to my documents, they get there but does not open.

    Download Adobe Reader; Uncheck the box first the Google toolbar:

    http://get.Adobe.com/reader/

    How to set file Associations:

    http://articles.TechRepublic.com.com/5100-10878_11-6172036.html

    How do I... Change file extension associations in Windows Vista?

    See you soon.

    Mick Murphy - Microsoft partner

  • More "label of instancebegineditable inside the editable region"

    I get an error message about instancebegineditable tag inside the editable region on http://www.jurpe.no/index.htm and I can't understand what is wrong. The error is apparently connected to line 12: <!-InstanceBeginEditable name = "description"-> and the template will not update the index file.

    Can anyone help? Thank you!

    Line 14, you have an incomplete tag.

    It should be this:

  • I'm taking classes online and since the new UPGRADE to 4, I can't download PDFs from the site unless they are less than 2 MB. It downloads for a few seconds then stops and no message appears.

    I connect to online courses. I click on the link to a PDF on the site. It gives the message it is downloading, then stops. With less than 2.0 MB PDF files load, but nothing more.

    No chance that your school uses Blackboard / WebCT?

    If so, Firefox 4.0 has not been certified as being compatible with this software.

    See this page in Blackboard KB to see which version of Firefox is certified for the version of Blackboard Learning System Vista or THIS used in your school.

    http://KB.Blackboard.com/pages/ViewPage.action?PageID=45581177

  • TabContext get null inside the dynamic region of the ADF.

    Hello

    I have a dynamic region is placed inside a jsff and in this dynamic region, on click of a button, I try to access TabContext using the piece delimit code. But TabContext is always null.

    TabContext tabContext = TabContext.getCurrentInstance ();
    System.out.println (tabContext);

    In fact, by getting the TabContext, my intention is to open a TaskFlow in a new tab.
    I have a tabContext parameter defined in the workflow that fell like a dynamic region. The jsff that contains this dynamic region, which also has the tabContext parameter defined.

    Can someone help me please?

    Thank you
    Gaurav.

    Hello

    .. .and that you have set the region on bindings setting? something like ${pageFlowScope.tabContext}

  • Download Business Intelligence view ADF regions?

    Hi all

    I need to download the extensions of Business Intelligence ADF view regions 11.1.1.7 but I can't do it, when I click on "check for updates" option does not figure in the list BI.

    I tried to download directly from here http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/131167.xml#oracle.biadf with no luck

    I'd appreciate your help,

    Jhon

    JDEV 11.1.1.7

    The link comes to temper at the end.
    Use http://download.oracle.com/otn-pub/jdeveloper/11.1.1.7.0/extensions/bi-adf_bundle.zip
    And you get the right file.

    Timo

  • Repeat regions inside the repeat regions

    I don't know how to do this.  Dreamweaver has said that we can not put server inside server behaviors behaviors.   But it seems like a pretty standard thing, someone might want to do.  For example:

    Suppose you want to create a menu online.  And say... you have two tables:

    Elements of array

    • item_id
    • Nom_element
    • item_description
    • item_price

    Ingredients of the table

    • ing_id
    • ing_name
    • item_id

    So, on your page, you want to display a repeat of each menu item region in the database.  In addition, within each menu item, you want to have a repeat region of each ingredient that has the same id of the element.

    Who is?  So, it can look like:

    Fishy lips
    Wonderful lips for all you lovers of the shady lip!  Get 'em today!

    Ingredients

    Fishy lips

    Seasoning ladle

    Herbs fish

    Fishy spices

    Luckity Hoppity
    Legs of amazing rabbit that bring good luck!

    Ingredients

    Rabbit legs

    Spices of rabbit

    Language of cow

    Sorry, I'm not a php programmer, but I can explain the concept.

    First of all, your idea to recover the two recordsets and then display the corresponding data in the inner loop should work. But it looks like you get the wrong records.  If I understand, you obtain a list of healthcare providers and then education for each display. Fix? If so, then the caregiver is the outer loop, and education is the inner loop, yet your inner loop made progress helping RS:mysql_fetch_assoc($getCaregiver)

    You could try just those switching.

    However, it is more common first retrieve the recordset of the outer loop. Then, when you browse, you need to run an internal recordset for each iteration of the outside. Your SQL for the internal RS has a filter so that it contains only the matching records.

  • fielset inside the adf page

    Hello

    I try to use fieldset ADF inside page with the following approach, but it displays the components outside the fieldset. I used the div
    inside and outside the fieldset also. But it's always the outdoor components display the fieldset. Can someone help me get the fieldsetset with the behavior of the legend.

    < fieldset >
    the legend <>process < / legend >
    < af:panelGroupLayout id = "pgl24" layout = "horizontal" >
    < af:inputDate value = "#{bindings." RenewalProcessDate.inputValue}.
    label = 'renewal '.
    required = "#{bindings." RenewalProcessDate.hints.mandatory}.
    shortDesc = "#{bindings." RenewalProcessDate.hints.tooltip}.
    ID = "id3".
    inlineStyle = "" white-space: nowrap; ">"
    < f: validator binding = "#{bindings." RenewalProcessDate.validator} "/ >"
    < af:convertDateTime pattern = "#{bindings." RenewalProcessDate.format} "/ >"
    < / af:inputDate >
    < af:inputText value = "#{bindings." RenewalProcessLevel.inputValue}.
    simple = 'true '.
    required = "#{bindings." RenewalProcessLevel.hints.mandatory}.
    columns = "#{bindings." RenewalProcessLevel.hints.displayWidth}.
    maximumLength = "#{bindings." RenewalProcessLevel.hints.precision}.
    shortDesc = "#{bindings." RenewalProcessLevel.hints.tooltip}.
    ID = "it30" >
    < f: validator binding = "#{bindings." RenewalProcessLevel.validator} "/ >"
    < af:convertNumber groupingUsed = "false".
    model = ' #{bindings. " RenewalProcessLevel.format} "/ >"
    < / af:inputText >
    < / af:panelGroupLayout >
    < / fieldset >

    Thank you and best regards,

    S R Prasad

    Hi prasad,.

    Add one more default panelGroupLayout before your fieldset



    Process of


    label = 'renewal '.
    required = "#{bindings." RenewalProcessDate.hints.mandatory}.
    shortDesc = "#{bindings." RenewalProcessDate.hints.tooltip}.
    ID = "id3".
    inlineStyle = "" white-space: nowrap; ">"




    simple = 'true '.
    required = "#{bindings." RenewalProcessLevel.hints.mandatory}.
    columns = "#{bindings." RenewalProcessLevel.hints.displayWidth}.
    maximumLength = "#{bindings." RenewalProcessLevel.hints.precision}.
    shortDesc = "#{bindings." RenewalProcessLevel.hints.tooltip}.
    ID = "it30" >


    model = ' #{bindings. " RenewalProcessLevel.format} "/ >"



    Kind regards
    Rami

  • How can I provide a downloadable PDF to the visitors of the site

    I have an educational Web site and I want to allow visitors to the site click to download a pdf file of an activity to use with students.  Do not have a clue as to how to proceed.  Help will be very appreciated.

    Create a folder on your site.  Download the zip on this issue and of course download the zip file, too. Provide a link to the file and the file should ask if you want to download the file automatically.

    In addition, you will need to create an index.htm page and link your zip file to that.

    Post edited by: JulesN

  • Find a component inside the jsf fragment using javascript in adf

    Hi all

    I use jdeveloper 11.1.1.5.
    I want to find a component inside my frgament of jsf using javascript.
    Inside the jspx page, I was able to find the component using
    AdfPage.PAGE.findComponentByAbsoluteId ("ID");

    Now my requirement is I have a fragment of jsf, and I want to find the component within jsf frgament using javascript.

    I'm looking for the component.


    Please suggest

    Thank you

    Published by: Navin K December 21, 2011 16:24

    Hello

    fragments are displayed in the ADF regions, which are containers of naming. So a good strategy would be to first find the region

    var region = AdfPage.PAGE.findComponentByAbsoluteId("regionId");
    
    if(region != null){
    
      var comp = region.findComponent("ID");
      ...
    } 
    

    Another option would be

      var comp = AdfPage.PAGE.findComponentByAbsoluteId("regionId:ID"); 
    

    If you have a side handle server for the component, and then a third option exists, which is to call getClientId on this element and pass the customer ID to the JavaScript (for example af:clientAttribute)

    Frank

  • How to view PDF files, inside the SWF or exe flash

    I create demand for employee details using flash actionscript 3.0

    This application is to display the details of employee organization, iam using the tree component in the present application,

    the tree component is to get the dada via xml file, save this xml file on the remote server.

    I display the PDF inside the SWF to the class 'StageWebView' help. Then I goto publish setting to change the Player Adobe Air 2.6 and run the file using flash

    CTR - l + enter. It's work correctly, the PDF appears inside the Swf output. But I publish this exe file. then I run the exe that does not work.

    The application is run, the xml data are get onely and display component of the tree, then I click on the name of the employee to point tree not display xml data and the pdf file is not open.

    Pls Help...

    StageWebView is an air 2.5, or the best class.  StageWebView not available for exe or swf embedded in html.

Maybe you are looking for

  • Headset controls does not not on IPOD

    I have two pairs of headphones I'm trying, both work 100% with my IPhone, but when I plug the headphones in my IPod I can't use the volumn or put Pause buttons. Music comes in 100% clear however, just can't use controls. I know that of not the headph

  • Firefox does not recognize Magnet links?

    I can't get Firefox to recognize Magnet links. How can I fix it? Thank you.

  • Can I make my own characters to my Firefox?

    I would like to customize my Firefox with the creation of my own characters, but is it possible? Or can I download those other characters?

  • Lenovo companion opens no more

    I have Lenovo Yoga. It is quite new. Win 10 included. Now, for some reason or another companion of Lenovo is unbootable. It is said that there's a problem and you need to restart pc. But the reboot will not help. I also treid to re - install app comp

  • HP Office Jet J6480 All In One - will not analyze with Mac OS 10,8.3

    I could not get my HP Office Jet J6480 All In One scanner after upgrading to 10.8.3.I followed other positions and have installed the most up to date driver (http://support.apple.com/kb/DL907) , but whenever I try to scan from the HP Device Manager o