File upload a4j:commandButton使用t:inputFileUpload提供NullPointerException

File upload a4j:commandButton使用t:inputFileUpload提供NullPointerException,file-upload,jsf-2,ajax4jsf,tomahawk,File Upload,Jsf 2,Ajax4jsf,Tomahawk,为什么对于下面的代码,当我使用t:commandButton时,它工作正常,而在a4j:commandButton的情况下,它在uploadedFile.getInputStream()上给出NullPointerException 不是重复的,但它可能与答案的主题有关。@Gamb我已经检查了所有与文件上传相关的问题,即使是您提到的问题,但我找不到我的答案。所以我不得不问这个!答案是一样的:@GuilhermeLemes谢谢你的回复,我当时才找到原因。我只是被richfaces的展示弄糊涂了。

为什么对于下面的代码,当我使用
t:commandButton
时,它工作正常,而在
a4j:commandButton
的情况下,它在
uploadedFile.getInputStream()
上给出
NullPointerException



不是重复的,但它可能与答案的主题有关。@Gamb我已经检查了所有与
文件上传相关的问题,即使是您提到的问题,但我找不到我的答案。所以我不得不问这个!答案是一样的:@GuilhermeLemes谢谢你的回复,我当时才找到原因。我只是被richfaces的展示弄糊涂了。
<h:form enctype="multipart/form-data">
    <t:inputFileUpload value="#{fileUploadController.uploadedFile}"/>
    <t:commandButton action="#{fileUploadController.insertFile}"/>      
</h:form>