Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-3162

Clarify as to when commons-fileupload and commons-io are necessary to include as <scope>compile</scope> dependencies for file upload

    Description

    Overview

    This issue serves as a task for clarifying as to when commons-fileupload and commons-io are necessary to include as portlet dependencies. The clarifications described here will be implemented at build-time by using maven profiles.

    Liferay Portal 7.0

    Liferay Portal 7.0 adheres to the JSR 286 Portlet 2.0 standard, which does not include file upload features in the Portlet API. Consequently, the FacesBridge cannot rely on the Portlet API to handle file uploads. However, the portal ships with commons-fileupload and commons-io deployed as OSGi modules:

    lb | grep Commons
       23|Active     |    6|Apache Commons FileUpload (1.3.2)
       24|Active     |    6|Commons IO (2.2.0)
    

    Because of this, it is not necessary to include commons-fileupload and commons-io as dependencies in JSF portlet projects in order to get file upload to work.

    Liferay Portal 6.2

    Similar to version 7.0, Liferay Portal 6.2 also adheres to the JSR 286 Portlet 2.0 standard. Consequently, the FacesBridge cannot rely on the Portlet API to handle file uploads. But unlike version 7.0, it does not ship with commons-fileupload and commons-io deployed as OSGi modules. Because of this, it is indeed necessary to include them as dependencies in JSF portlet projects in order to get file upload to work.

    Pluto 3.0

    Since Pluto 3.0 adheres to the JSR 362 Portlet 3.0 standard, it is required to implement the ClientDataRequest.getPart(String) and ClientDataRequest.getParts() methods. As an implementation detail, it relies on the corresponding methods on HttpServletRequest. Since Tomcat implements the Servlet 3.0 API, it provides its own ability to handle file upload that is transparent to the developer.

    The JSR 378 Specification requires that the FacesBridge utilize the Portlet 3.0 API to handle file upload, so it is not necessary to include commons-fileupload and commons-io as dependencies in JSF portlet projects in order to get file upload to work.

    Pluto 2.0

    Pluto 2.0 adheres to the JSR 286 Portlet 2.0 standard, which does not include file upload features in the Portlet API. Consequently, the FacesBridge cannot rely on the Portlet API to handle file uploads. Therefore, it is indeed necessary to include commons-fileupload and commons-io as dependencies in JSF portlet projects in order to get file upload to work.

      Attachments

        Activity

          People

          • Assignee:
            neil.griffin Neil Griffin
            Reporter:
            neil.griffin Neil Griffin
            Participants of an Issue:
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Packages

              Version Package
              bridge-impl-4.1.0
              portal-3.0.1
              alloy-archetype-5.0.2
              jsf-archetype-5.0.2
              primefaces-archetype-5.0.2
              richfaces-archetype-5.0.2
              bootsfaces-archetype-5.0.0
              butterfaces-archetype-5.0.0