fileDownloadActionListener only works on the integrated server

IM using Jdev 12.1.2. Im trying to create a file with fileDownloadActionListener. I have the listener on a button and everything works correctly when running on the integrated server jdev, but when I deploy it to another server I always get an empty file. Am I missing something? I have to use a servlet?

I use the following method. Very basic for testing purposes.

' Public Sub downloadReport (FacesContext facesContext, outputStream java.io.OutputStream) {}

try {}

Writer writer = new OutputStreamWriter (outputStream);

Writer.Write ("hello world");

Writer.Close ();

} catch (Exception e) {}

}

I added writer.write ("Content-type: text/html\n");

You cannot add the type of content like this ("Content-Type" header of HTTP is, so you can't write in the body of the message).

changed its text/html content type as I was using application/msword.

Yes, this is the right way to set the content type if you use af:fileDownloadActionListener

You must also set property "filename".

also, I went into my fileDownloadActionListener and changed its text/html content type as I was using application/msword. I thought that perhaps, given that my production server is a linux machine it was having a problem with msword, but I'm still running into the same question when changing text/html.

This is just the http header so no matter if you run the WLS server on win/lin/mac

Check the version of the ADF on autonomous WLS (perhaps the field spread with 12.1.3 libs so here's some issue with runtime incompatibility)

What is the property settings of 'partialSubmit' on your button (try partialSubmit = false)?

Maybe you can try to implement features provided by af:fileDownloadActionListener for yourself, something like:

public void downloadFile(ActionEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();
    HttpServletResponse httpResponse = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();

    httpResponse.reset();
    httpResponse.setHeader("Content-Type", "text/plain");
    httpResponse.setHeader("Content-Disposition", "attachment;filename=somefile.txt");

    try {
        Writer writer = new OutputStreamWriter(httpResponse.getOutputStream());
        writer.write("hello world");
        writer.flush();
    } catch (IOException e) {
        e.printStackTrace();
    }

    fc.responseComplete();
}

(remove af:fileDownloadActionListener then attach this method to the actionListener and partialSubmit set to false property)

In addition, you can try with servlet custom instead of af: fileDownloadActionListener...

Dario

Tags: Java

Similar Questions

  • Satellite A210 - 10 c only works with the 800 Mhz instead of 1.6 Ghz

    Hello

    I have a very big problem. One day, I look in Vista on my resource monitor and see that the max freuquence is only 50%.

    So first of all I think that is no problem because the assets 'energy savings' energy recorded.
    I have a Satellite A210 - 10 c portable.

    So I switch to maximum power and perform a test of prime95. But hell, the max freuquence has not changed. I also installed everest and cpu z, but all programs show the same to me:

    My laptop only works with the 800 Mhz instead of 1.6 Ghz!

    I'm looking for drivers for the AMD processor, but you need not for Vista. Update all the drivers of Toshiba and Programms and BIOS (in fact, it is the 1.9).

    Nothing helps.

    As a last test, I reinstalled Vista, but also did not help.

    And now I'm at a loss what to do.

    I hope someone can help me.

    Good bye...

    Have you installed the Vista using the recovery CD or the original CD of Microsoft Vista?

    I ask because the restore CD contains all drivers for Toshiba and yellow exclamation marks should not be apparently in Device Manager.

    If you used the original CD of Vista I think that you have not installed the Package of Intel Robson.

    I found the package of Robson on the Toshiba driver-> Satellite P200 area page.

    Maybe you should check this.

    Your comments would be appreciated

  • LabVIEW 2013 executable only works on the development machine?

    Hi all

    I created an executable to distribute my test software, but it only works on the development computer. With success, I gave my front executables with labview 2012 on the target computers by simply creating the .exe in the project and then Explorer in installing labview nessary drivers and run the engine of time without problems. Now, I created a new test with Labview 2013 program and I can not get my new test .exe application to run on the target computer. Has anyone seen this kind of problem before?  Any help will be appreciated.

    Thank you


  • BlackBerry Z10 headphone only works with the left ear

    My headphones (beats studios) only works with the left ear when connected. The helmet has never had a problem on my old iPhone 4 and currently with my rMBP so I know that's not the headphones. Any suggestions?

    There seems to be a problem with the jacket of the head. They are defective for a few pieces and the jacket cannot recognize the HP in the same case, what makes the phone to give no sounds on the notification.

    Try to use different headphones. If the problem persists try replacing the model.

  • The latest changes to the 'Upload to the FTP host' function has made it useless - no point using a program such as Muse if I can't easily and automatically upload work to the Web server.

    The latest changes to the "Upload to Host FTP" function made it useless - no point using a program such as Muse if I can't easily and automatically upload work to the Web server.  I use BlueHost webhosting with a main area and I have several domains with this account (such as subdomains or folders on this server) - with older versions of Muse when downloading pages it simply opened a warning window to tell me (what I already know) the Web site I am downloading does not point to the main domain BUT now Muse is trying to create a new folder separated into the root directory of the main domain. completely ignoring the directory path that I am giving him - useless!  Why do these crazy changes to the program - and so often - it is very frustrating as amateur ware!

    Hello Stephen,

    There are some problems with the download of ftp through Muse, who knows the team of engineers and those will be corrected in a future version of Muse. At this point, the work around would be to export the html code of Muse and then download via some third party client like filezilla ftp.

    I would recommend that you keep an eye on our page of release notes to get updates more about it - Release notes | Adobe Muse CC

    - Abhishek Maurya

  • CSS only works on the page and not in the css doc

    So I have the following code for the shadows: h3.a {text-shadow:-50px 50px white, 1px 1px #00F}.  I put it on my css doc which is connected to my page, but it does not appear.  then I put it in the top of the page, and then it appeared.  Why it only works on the page?

    I just passed something like that for a few hours yesterday and realized that I was not saving the page external .css real after adding new styles.

  • Uploading to FTP host... only works with the file of the Web server root

    When I download a Muse site to the root of the Web server, everything works as expected with the obvious comparison.

    But if I want to download on a file/folder existing... it doesn't work. Muse download files but no files are added on my Web server.

    I know how to add the path if I do something wrong or there at - it a bug somewhere?

    Thank you.

    I should add that the Muse site emergency or any html Web site doesn't not any sense. Backup is only valid for cms. And this isn't just a copy of the files in the site, it has a copy of the database. Muse has no database. Backup of the Muse - is file.muse, which can be placed anywhere.

  • iPads not working only not with the cache server

    Hello!

    We have implemented a Server Cache El Capitan... And the strange thing is that it works with macs and iPhones but not with iPads! Has anyone of you ever heard of something similar?

    Thanks in advance!

    Carl

    It works with macs and iPhones but not with iPads!

    There are many variables that affect how to find caching servers Apple devices.  Signed iPads on the same account iCloud like Macs and iPhones, or more precisely, are the accounts that iPads are signed in registered in the same country as the public IP address of the server being cached?  If your organization uses multiple public IP addresses, are the server cache and your DNS server set up correctly in what concerns these addresses?  Did you restart the iPads after implementation of the caching server, so that they immediately "forget" that they have found no update server caching and are forced to review?  (Restart devices - not the server!-is also recommended if you change the public address record in DNS.)  IPads use a different local subnet as other devices, maybe a caching server is not configured to serve?

    We can help you, but we need more information.

  • Typeset only work on the platform built on the Web site

    Hello.

    I'm going to build a Web site that is currently on my development server. http://www.thepointnet.com/NovaTec-development

    I use a Typeset font (make-family: ' Fira without ";) in the CSS and it will only appear on the site when I view it on the same Mac as I build the site on.)

    Seen on a smart phone or on another PC it's just default the without police.

    I've lived any suggestions for troubleshooting Adobes does not.

    Someone at - it indexes?

    Thank you

    Joe

    Hey Joe,

    I'm sorry that you trouble with that. The CSS on your site uses the font family name "Fira without", for example

    {.navbar-css

    color: rgba (255, 255, 255, 1);

    do-family: ' Fira without. "

    do-size: 130%;

    make-style: normal;

    Police-weight: 300;

    }

    The name provided by Typekit is "fira - without", with a hyphen. The browser is looking for a locally installed version of the police currently, rather than the files provided by Typekit.

    If you update the CSS file to use "fira - without" everywhere that you have "Fira without", policies should begin to work in all browsers and operating systems.

    (For later use, you can check the last name of Typekit in the Editor Kit by clicking on the link "Fonts in CSS using" selectors):

    ( https://helpx.adobe.com/typekit/using/css-selectors.html)

    If please give that a try and let us know if you have any other questions!  Best,

    -liz

  • I built a website in Muse that has a built-in Ecwid basket. There are currently on another server. Who works on the BC Server?

    This site is currently is on another server. I can delegate it to the BC server and Ecwid will work?

    Yes it should work fine no matter what server it is on. But of course, if you are the host the BC why not use the e-commerce module integrated BC?

  • Apple tv only works on the left speaker

    Through any HDMI input audio left is the only work, regardless of the selection of entries.

    Two audio channels running on all HDMI inputs when tested with a DVD player, had the same problem with Google Chrome and referred to the shop. Everyone knows about this phenomenon?

    carpet

    It would sound as if you have confirmed that the question must be with the device and is not the cable or TV. How old is this particular Apple TV? It is still under warranty or AppleCare?

    TT2

  • Firefox does not start, no error message, only works in the background

    I click on Firefox it does not start
    no error message it does not start
    It works in the background in 32-bit
    I have re installed it but nothing changes

    It is possible that your security (firewall, antivirus) software blocks or limit Firefox or the process of plugin-container without you inform, possibly after the detection of changes (update) for the Firefox program.

    Delete all rules for Firefox and the plugin-container in the permissions list in the firewall and leave your firewall again ask permission to get full unlimited access to the internet for Firefox and the plugin-container and the update process.

    See:

  • L50-B-1NM satellite - wifi only works near the router

    Hi just bought this laptop for my daughter Toshiba L50-B-1NM 15.6 inches processor Ci3 4 GB 1 TB and wifi only works if he was sitting next to the router.

    It will connect to the internet if the ethernet cable is connected, BUT for wifi, the laptop has been sitting almost touch the router. The rest of the House works well.

    Please could you help me before I take it back to the shop and eventually making a fool of myself.

    I'm really not good with technology so if you do not answer could you explain to me like a baby please ;) lol

    Thank you very much, totally disappointed at the moment because it cost me a lot of money for it :(

    Hi maria,

    I think you should consider a fact: the L50-B-1NM Satellite was equipped with an Intel 802.11ac + card agn combo Wifi/BT.

    802.11 AC is a new WLan standard that isn't taken care of by all old WLan routers.
    But of course, the standard 802.11 A / G or N must be supported by older devices correctly.

    I think first of all you must check if the wireless performance question isn't related to energy saving settings. I guess during wifi problems, the laptop uses battery power
    In this case we would use different power plan settings.

    Please check the settings that are in the advanced within the current energy saving Central WLan power settings.

    Where this doesn t help you solve the problem of WiFi signal weak, you should contact the authorized Toshiba maintainer to check the connection to the WLan antenna.

    It may be possible that the antenna isn't properly connected, which is originally a weak WiFi signal.

    Because the laptop is under warranty, it should be fix toll-free number.

    Greetings

  • No sound work of the integrated sound card since the withdrawal of another sound card

    When I bought my pc from Dell, I installed a map 5.1 sound. However I now need to use the pc for a wireless card slot, so removed the sound card and hoped to return to the integrated sound card. Although he seems to think that all devices are working correctly, when I try to listen, by using the sockets on the back or forward, there is no sound. The audio realtek manages it say that there is no device plugged into the system.

    Hello

    Check with the manufacturer of the sound card documentation to see what this cable.
    (What is the brand and the exact card model - if you need help to find
    the instructions that they should be available on the site and Google?)

    Check with Dell Support, their documentation online, and their forums for
    known issues as this sound more like a hardware issue that some pilots
    (Links above).

    ================================================

    Maybe an upgrade in Place or the repair facility might help. Do not forget to
    make a good backup or three.

    On-site upgrade
    http://vistasupport.MVPs.org/repair_a_vista_installation_using_the_upgrade_option_of_the_vista_dvd.htm

    This tells you how to access the System Recovery Options and/or a Vista DVD
    http://Windows.Microsoft.com/en-us/Windows-Vista/what-happened-to-the-recovery-console

    How to perform a repair for Vista Installation
    http://www.Vistax64.com/tutorials/88236-repair-install-Vista.html

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • BlackBerry Smartphones set up Storm at work with the Professional Server

    We have several blackberry devices works on our professional Server (v4.1.4.15), however, we now have a user with a storm. We can't locate the device where to plug the server information and the auto-generated password?

    I don't have the camera in front of me so I can't just go around in it to know where to go, I'm talking about a user through it at the other end.

    Someone would be likely to make me know, from a very basic start screen, where to intervene in this device so that we can activate it with our professional server?

    I thank very you much for any help you can offer.

    So it turns out that it was because the user doesn't have that good data plan on his phone. He called the carrier, changed to a business plan, now the icon appears.

Maybe you are looking for

  • How can I move programs from C to E?

    my C drive is nearly full, but my E drive is empty. I can (and how) move programs from C to E?

  • Does not load disc

    When I insert a disc, label to me, I hear it go, but it does not appear on my desktop or the finder. Halp!

  • LabVIEW 7 Express will not wire connections

    I use an old computer at work that has LabVIEW 7 Express. When trying to do a VI, I can place sub - VI on the block diagram, but I am unable to what wire. In addition, I can not change the size of text boxes or graphics on the front panel. Is there s

  • How to make SOAP client ssl (https) request call with c# in Visual Studio 2010?

    Hello I have https wsdl as https://128.107.155.166:8443/nbapi/event /? WSDL path and I would use as tool for vs2010 with proxy class add 'a service reference. At the present time, the proxy class already created by "a service reference" of vs2010 as

  • How to stop an another tracker to your utorrent

    Azureus, from: debarnes. Is anyone able to help? How can you - stop an another "Traker" to go to your Utorrent - deleting messages as if they were God Internet; I ask as Azureus has this little habit on a Hex - I get this message from heaven, saying: