Details
Description
And as implemented in the ICEfaces <ice:inputFile/> tutorials:
http://facestutorials.icefaces.org/tutorial/inputFile-tutorial.html
Does not work with Liferay 4.3.0 (pre-release).
The way it manifests itself, is that although the progressListener method is called in the bean, the browser's DOM is not updated with the percent done.
I'll attach an example portlet shortly.
-
Hide
- sample-jsf-icefaces-sun-portlet.zip
- 4.36 MB
- Neil Griffin
-
- sample-jsf-icefaces-sun-portlet/Edit.jspx 0.7 kB
- sample-jsf-icefaces-sun-portlet/Help.jspx 0.7 kB
- sample-jsf-icefaces-sun-portlet/.../context.xml 0.3 kB
- sample-jsf-icefaces-sun-portlet/.../MANIFEST.MF 0.1 kB
- sample-jsf-icefaces-sun-portlet/View.jspx 8 kB
- sample-jsf-icefaces-sun-portlet/.../FileUploaderManagedBean.class 6 kB
- sample-jsf-icefaces-sun-portlet/.../ActionOutcomes.class 0.4 kB
- sample-jsf-icefaces-sun-portlet/.../EmailAddressValidator.class 2 kB
- sample-jsf-icefaces-sun-portlet/.../FacesMessageUtil.class 4 kB
- sample-jsf-icefaces-sun-portlet/.../PhoneNumberConverter.class 4 kB
- sample-jsf-icefaces-sun-portlet/.../PortalPreferenceUtil.class 2 kB
- sample-jsf-icefaces-sun-portlet/.../ResourceBundleUtil.class 1 kB
- sample-jsf-icefaces-sun-portlet/.../JobApplication.class 2 kB
- sample-jsf-icefaces-sun-portlet/.../PortalUser.class 1 kB
- sample-jsf-icefaces-sun-portlet/.../ResumeUploader.class 0.8 kB
- sample-jsf-icefaces-sun-portlet/.../JobApplication.properties 0.2 kB
- sample-jsf-icefaces-sun-portlet/.../Language.properties 0.7 kB
- sample-jsf-icefaces-sun-portlet/.../faces-config.xml 3 kB
- sample-jsf-icefaces-sun-portlet/.../geronimo-web.xml 1 kB
- sample-jsf-icefaces-sun-portlet/.../backport-util-concurrent.jar 343 kB
- sample-jsf-icefaces-sun-portlet/.../commons-beanutils.jar 184 kB
- sample-jsf-icefaces-sun-portlet/.../commons-collections.jar 546 kB
- sample-jsf-icefaces-sun-portlet/.../commons-digester.jar 107 kB
- sample-jsf-icefaces-sun-portlet/.../commons-fileupload.jar 52 kB
- sample-jsf-icefaces-sun-portlet/.../commons-validator.jar 136 kB
- sample-jsf-icefaces-sun-portlet/.../el-api.jar 24 kB
- sample-jsf-icefaces-sun-portlet/.../icefaces.jar 644 kB
- sample-jsf-icefaces-sun-portlet/.../icefaces-comps.jar 629 kB
- sample-jsf-icefaces-sun-portlet/.../jsf-api.jar 356 kB
- sample-jsf-icefaces-sun-portlet/.../jsf-impl.jar 778 kB
Issue Links
- blocks
-
ICE-1809 Support for Liferay Portal
- Closed
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Looks like we can improve behaviour by adjust the web.xml configuration to use the "old" servlets and mappings. Since the refactor of 1.6, traffic generally flows through the MainServlet. However, this is not yet officially supported and by switching back to the 1.5 servlets and mappings, the input file seems to work better.
So change these servlets and mappings:
<servlet>
<servlet-name>Main Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.http.servlet.MainServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Main Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Main Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Main Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>
back to:
<servlet>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/uploadHtml</url-pattern>
</servlet-mapping>
There is still some outstanding issues on file upload that we're looking at so it may not be completely functional yet. A JIRA should be opened shortly to deal with this.
The other thing that I wanted to mention is that we don't recommend the direct use of PersistentFacesState.render. Instead, as shown in the tutorial and component-showcase examples, you should get a reference to a RenderManager (application-scoped) and call requestRender.
Marking as FIXED.
My tests show that both Auction Monitor and TimeZone work fine as portlets. The current caveat is that if you have multiple server-push portlets that they be deployed in the same war (so that they can share the same blocking connection).
The final sample-jsf-sun-portlet.war that got posted here:
http://www.liferay.com/web/guest/downloads/samples
... makes use of the "labelComplete" instead of the way I was doing it with the attached portlet. I actually like this "labelComplete" way better, so even though the original buggy behavior can be reproduced, I think Deryk did the right thing by closing this one.
Thanks!
Neil
Unzip to the webapps folder, and after Liferay starts, you'll see the portlet under the "Test" category