ICEfaces
  1. ICEfaces
  2. ICE-10654

ace:dynamicResource - fileName and mimeType issues

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-4.0.0.GA
    • Fix Version/s: 4.1
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P1
    • Support Case References:
    • Affects:
      Compatibility/Configuration
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      For Issue #2: In debugging this issue with an isolated test case I was unable to reproduce the issue. I found that the major different was that my welcome page was defined as faces/index.xhtml, where as the Showcase and customer sample does not.

      In my sample it hovering over the download link had the following URL:
       - http://localhost:8080/Case13396Example/faces/javax.faces.resource/78f7b9ba
      Compared to (notice the missing /faces/ in the url):
       - http://localhost:8080/Case13396Example/javax.faces.resource/78f7b9ba.jsf

      Having my sample start with the /faces/ servlet mapping allowed the resources to not have the .jsf extension added.
       
      Show
      For Issue #2: In debugging this issue with an isolated test case I was unable to reproduce the issue. I found that the major different was that my welcome page was defined as faces/index.xhtml, where as the Showcase and customer sample does not. In my sample it hovering over the download link had the following URL:  - http://localhost:8080/Case13396Example/faces/javax.faces.resource/78f7b9ba Compared to (notice the missing /faces/ in the url):  - http://localhost:8080/Case13396Example/javax.faces.resource/78f7b9ba.jsf Having my sample start with the /faces/ servlet mapping allowed the resources to not have the .jsf extension added.  

      Description

      Two issues have been found with the ace:dynamicResource component. These issues can be reproduced/demonstrated with the Showcase demo.

      Issue #1: Setting the fileName attribute has no effect on the resulting file. For example the Showcase demo uses fileName="icemobile.pdf". The resulting file is 7c8f5d0a.jsf.

      Issue #2: Somewhat related to above, when downloading the file it has a .jsf file extension added to the resource. In some cases this can cause issues as it is a PDF file and not a JSF page. It seems like the resource is being processed by the Faces Servlet as a page and not a file.

        Activity

        Hide
        Arran Mccullough added a comment -

        I do have a sample that shows these issues as well if the Showcase demo is not enough.

        Show
        Arran Mccullough added a comment - I do have a sample that shows these issues as well if the Showcase demo is not enough.
        Hide
        Arturo Zambrano added a comment -

        r44971: deprecated 'attachment' attribute and modified behaviour of 'fileName' attribute to automatically download file as an attachment; updated TLD documentation.

        The issue was that the 'fileName' attribute only worked when the 'attachment' attribute was true. Since, there was no other use for the 'attachment' attribute by itself (it just downloaded the file as <random-string>.jsf), it was deprecated, and now files are automatically downloaded as attachments when a specific file name is set.

        Show
        Arturo Zambrano added a comment - r44971: deprecated 'attachment' attribute and modified behaviour of 'fileName' attribute to automatically download file as an attachment; updated TLD documentation. The issue was that the 'fileName' attribute only worked when the 'attachment' attribute was true. Since, there was no other use for the 'attachment' attribute by itself (it just downloaded the file as <random-string>.jsf), it was deprecated, and now files are automatically downloaded as attachments when a specific file name is set.
        Hide
        Arturo Zambrano added a comment -

        44972: updated ICEfaces showcase demos to adjust to new changes.

        Show
        Arturo Zambrano added a comment - 44972: updated ICEfaces showcase demos to adjust to new changes.
        Hide
        Liana Munroe added a comment -

        Tested with showcase and ICEfaces 4 trunk r44976.
        If there is a custom file name entered and then "Download as attachment?" is toggled to false, the custom file name remains as the value in the h:inputText and becomes disabled. When using the download button at this point, a new tab still opens with a random string .jsf file (/3b95c490.jsf) displayed. Is this the expected behaviour?

        Show
        Liana Munroe added a comment - Tested with showcase and ICEfaces 4 trunk r44976. If there is a custom file name entered and then "Download as attachment?" is toggled to false, the custom file name remains as the value in the h:inputText and becomes disabled. When using the download button at this point, a new tab still opens with a random string .jsf file (/3b95c490.jsf) displayed. Is this the expected behaviour?
        Hide
        Ken Fyten added a comment -

        Yes, that is the expected behaviour. With this change the custom file name is only used in "Download as attachment" mode.

        Show
        Ken Fyten added a comment - Yes, that is the expected behaviour. With this change the custom file name is only used in "Download as attachment" mode.
        Hide
        Liana Munroe added a comment -

        Verified ICEfaces 4 trunk r44976. Tomcat 7, Chrome 43, IE 11, FF 34

        Show
        Liana Munroe added a comment - Verified ICEfaces 4 trunk r44976. Tomcat 7, Chrome 43, IE 11, FF 34
        Hide
        Markus Guenther added a comment -

        This is still not working in IceFaces 4.3 in the showcase.
        Do change the filename and check the name of the downloaded file, they do not match. Looks like the name is always the same and the entered value is never taken into account.

        Show
        Markus Guenther added a comment - This is still not working in IceFaces 4.3 in the showcase. Do change the filename and check the name of the downloaded file, they do not match. Looks like the name is always the same and the entered value is never taken into account.

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: