简体   繁体   中英

Change encoding of adf rich faces' fileDownloadActionListener

I am using fileDownloadActionListener as follows:

<af:fileDownloadActionListener contentType="text/plain; charset=ISO-8859-15"
     filename="#{row.FileName}.txt"
     method="#{backingBeanScope.backing_pages_general_files_download.downloadFile}"/>

The download works fine.

I have the application deployed on weblogic:

  1. Locally on Windows
  2. Remotely on Linux

When I download the file from Windows deployment and open by notepad it shows encoding ANSI When I download the file from Linux deployment and open by notepad it shows UTF-8

But I need the encoding of the dowmloaded file to be ISO-8859-15 .

Any help would be appreciated.

I did it in the following way:

  1. I accessed the file_to_read_from with UTF-8 format
  2. I changed the contents to ISO-8859-15
  3. I fetched the bytes_to_write and converted to ISO-8859-15
  4. I put both to an byte array with ISO-8859-15 format
  5. Changed the jspx that contains the view to contents of ISO-8859-15

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM