我正在尝试像primefaces用户指南中记录的那样工作,并在那里创建了一些帖子.
环境是:javaee full + jpa + jsf 2.2 + primefaces 4 + glassfish v4
我再次发帖,因为我已经尝试了我在网上找到的每一个样本和建议,都没有成功.
我能够使用:event.getFile.getFileName获取文件上传名称,但内容始终为null
- - - - - - -更新 - - - - - - - - - - - - - -
我的xhtml页面:
<h:form enctype="multipart/form-data">
<p:outputLabel value="La photo :"/>
<p:fileUpload fileUploadListener="#{personController.upload}"
mode="advanced"
update="messages"
sizeLimit="100000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
<p:growl id="messages" showDetail="true"/>
</h:form>
Run Code Online (Sandbox Code Playgroud)
我的托管bean:
@Named(value = "personController")
@SessionScoped
public class PersonController implements Serializable {
/**
* Creates a new instance of PersonController
*/
@Inject
private PersonneFacade …Run Code Online (Sandbox Code Playgroud)