-
1. fileUpload with JSF 2 and RF 3.3.3
oliverg Jan 19, 2011 4:23 PM (in response to oliverg)BTW: web.xml settings are okay. We prooved that this is not a problem of limited session timeout or limited upload size.
-
2. fileUpload with JSF 2 and RF 3.3.3
ilya40umov Jan 20, 2011 12:11 AM (in response to oliverg)javax.faces.application.ViewExpiredException means that a user's session has expired. You can try to increase time of the session for your application.
The following strings should do the trick:
<session-config>
<session-timeout>120</session-timeout>
</session-config>
Or you can try HttpSession setMaxInactiveInterval as an alternative.
-
3. fileUpload with JSF 2 and RF 3.3.3
oliverg Jan 20, 2011 3:33 AM (in response to ilya40umov)As I mentioned above, the session-timeout has a high value in web.xml and the upload of some MB fails after 2 or 3 minutes (after login).
BTW: The handling bean has request scope and KeepAlive-Annotation
-
4. fileUpload with JSF 2 and RF 3.3.3
ilya40umov Jan 20, 2011 3:49 AM (in response to oliverg)Hm. If you are using KeepAlive-Annotation this question will be answered better by RF team.
-
5. fileUpload with JSF 2 and RF 3.3.3
ilya_shaikovsky Jan 20, 2011 4:33 AM (in response to oliverg)please show the code.
-
6. Re: fileUpload with JSF 2 and RF 3.3.3
oliverg Jan 20, 2011 5:56 AM (in response to ilya_shaikovsky)We found a little trade-off: we set allowFlash="auto". Then big file uploads work for guys who have Flash in their browser (but not if they have no Flash). In our case, we cannot be sure if all customers have Flash-Plugin, but the probabillity is high, i think.
Previous code:
{code}
<rich:fileUpload id="fileUpload" locale="#{sessionBean.language}" maxFilesQuantity="#{bean.uploadsAvailable}"
allowFlash="false" status="waitStatus" fileUploadListener="#{bean.listener}" ajaxSingle="true"
doneLabel="#{labels.rich_fileUpload_done}" listHeight="65px" immediateUpload="true"
transferErrorLabel="#{bean.transferError}" transferErrorLabelClass="fileUploadTransferError"
sizeErrorLabel="#{messages.bean_file_maxsize}" sizeErrorLabelClass="fileUploadTransferError"
acceptedTypes="#{bean.acceptedTypes}">
<a4j:support event="onclear" reRender="fileUpload,uploadPanelSelect" action="#{bean.clear}" ajaxSingle="true" />
<a4j:support event="onfileuploadcomplete" reRender="uploadPanelSelect" limitToList="true" />
<a4j:support event="ontyperejected" reRender="uploadForm" action="#{bean.onTypeRejected}" ajaxSingle="true" />
<f:facet name="label">
<h:outputText
value="{_MB} MB #{labels.rich_fileUpload_from} {MB} MB #{labels.rich_fileUpload_uploaded} ({mm}:{ss})" />
</f:facet>
</rich:fileUpload>
{code}
{code}
public void listener(final UploadEvent event) {
if (event.getUploadItem() == null) return;
setUploadItem(event.getUploadItem());
uploadsAvailable--;
}
{code}
Some web.xml settings:
{code}
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>forceparser</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>createTempFiles</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>maxRequestSize</param-name>
<param-value>1000000000</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
{code}