Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
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.