problem in using <t:inputFileUpload>
I have followed this 开发者_C百科tutorial from BalusC for FileUpload. but setter isn't getting called
That can have the following causes:
The
enctype="multipart/form-data"
attribute is missing on the<h:form>
. This is mandatory in order to be able to send files to the server.The
ExtensionsFilter
is missing inweb.xml
or not properly mapped on the servlet name of theFacesServlet
. This is mandatory in order to be able to parse themultipart/form-data
request.There is another filter in the request-response chain before the
ExtensionsFilter
which has already parsed the multipart/form-data request beforehand. For example, when you're using RichFaces4, such a filter will be auto-loaded without that you need to declare it inweb.xml
. Request bodies can be parsed only once, so theExtensionsFilter
would receive an empty request after such another filter.There is another filter in the request-response chain before the
ExtensionsFilter
which has completely skipped theExtensionsFilter
by for example forwarding or redirecting the request.
精彩评论