FileUploader under Spring Web Flow, Security

UI Components for JSF
Post Reply
hfcprime
Posts: 108
Joined: 22 Feb 2011, 20:32

19 Aug 2011, 15:00

Does anyone have FileUploader working under Spring Web Flow and Security? Can't do it. Under debug, with the Prime source attached, init() is called on the filter, but never doFilter(). The request is never sent or never arrives. This is 3.0M3Snapshot. The chooser opens up and I can browse and select a file. Clicking the upload icon puts the progress bar thru its paces. But the listener is never called. Thanks for any advice. Here are the pieces.

web.xml:

<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>thresholdSize</param-name>
<param-value>2097512</param-value>
</init-param>
</filter>

<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

faces.config:

<managed-bean>
<managed-bean-name>fileUploader</managed-bean-name>
<managed-bean-class>com.kve.requisitions.listeners.FileUploader</managed-bean-class>
<managed-property>
<property-name>uploadDirectory</property-name>
<value>C:/RequisitionAttachments</value>
</managed-property>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>

com.kve.requisitions.listeners.FileUploader:


public void handleFileUpload(FileUploadEvent event) {
...
}
public void setUploadDirectory(String d) ...
pblic String getUploadDirectory() ...

Page code:

<h:form enctype="multipart/form-data" prependId="false">
<p:panel header="#{req.title}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Attachments" toggleable="true" collapsed="false" togglespeed="100">
<h:panelGrid columns="2">
<p:fileUpload id="fileUploader" mode="advanced" sizeLimit="2097152"
fileUploadListener="#{fileUploader.handleFileUpload}" />
<p:dataTable id="attachments" var="atch" value="#{req.attachments}">
<f:facet name="header">Attachments</f:facet>
<p:column><h:outputText value="#{atch.filename}"></h:outputText></p:column>
</p:dataTable>
</h:panelGrid>
</p:panel>
</h:form>
ENVIRONMENT
Angular 5.2.4, CLI 1.6.8, PrimeNG 5.2.0, Chrome 64.0.3282.186, Angular CLI project in Webclipse IDE, Win 10 Pro

hfcprime
Posts: 108
Joined: 22 Feb 2011, 20:32

21 Aug 2011, 22:53

Here is an excerpt from the Tomcat log. I selected a file and clicked on the upload icon. There are requests for the fileupload.css and for the fileupload.js. What else should be here and why is it missing? Thanks.

127.0.0.1 - - [21/Aug/2011:16:39:39 -0400] "GET /RequisitionsPF/req/javax.faces.resource/fileupload/fileupload.css?ln=primefaces&v=3.0.M3-SNAPSHOT HTTP/1.1" 304 -
127.0.0.1 - - [21/Aug/2011:16:39:39 -0400] "GET /RequisitionsPF/req/javax.faces.resource/paginator/paginator.js?ln=primefaces&v=3.0.M3-SNAPSHOT HTTP/1.1" 304 -
127.0.0.1 - - [21/Aug/2011:16:39:39 -0400] "GET /RequisitionsPF/req/javax.faces.resource/fileupload/fileupload.js?ln=primefaces&v=3.0.M3-SNAPSHOT HTTP/1.1" 304 -
127.0.0.1 - - [21/Aug/2011:16:39:39 -0400] "GET /RequisitionsPF/req/javax.faces.resource/jsf.js?ln=javax.faces&stage=Development HTTP/1.1" 304 -
127.0.0.1 - - [21/Aug/2011:16:39:39 -0400] "GET /RequisitionsPF/req/javax.faces.resource/datatable/datatable.js?ln=primefaces&v=3.0.M3-SNAPSHOT HTTP/1.1" 304 -
127.0.0.1 - - [21/Aug/2011:16:40:13 -0400] "POST /RequisitionsPF/req/search?execution=e1s2 HTTP/1.1" 200 155
127.0.0.1 - - [21/Aug/2011:16:40:20 -0400] "POST /RequisitionsPF/req/search?execution=e1s2 HTTP/1.1" 200 155
ENVIRONMENT
Angular 5.2.4, CLI 1.6.8, PrimeNG 5.2.0, Chrome 64.0.3282.186, Angular CLI project in Webclipse IDE, Win 10 Pro

gene
Posts: 6
Joined: 20 Jan 2011, 19:10

19 Mar 2012, 23:45

Try replacing:
<servlet-name>Faces Servlet</servlet-name>
with:
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
if Spring MVC Dispatcher Servlet is mapped to org.springframework.web.servlet.DispatcherServlet.
That should invoke the filter.

However, there is an additional problem with Spring Web Flow: https://jira.springsource.org/browse/SWF-1529
The issue was resolved and the fix should become available in SWF 2.3.1.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Baidu [Spider], Google [Bot] and 10 guests