English 中文(简体)
p.fileupload dont work on Websphere 8
原标题:p:fileupload doesnt work on Websphere 8

我很想知道,是否有任何人设法取得标语<代码>p:fileupload。 网络应用8服务器的部分工作

我使用了2.2.1总理版本。

JSF Code:

<h:form enctype="multipart/form-data">  
    <p:fileUpload 
            fileUploadListener="#{mailBean.handleFileUpload}"   
            multiple="true" 
            label="choose" 
            allowTypes="*.jpg;*.png;*.gif;" 
            description="Images"/>          
</h:form>

Managed Bean Code:

public void handleFileUpload(FileUploadEvent event) 
{  
    files.add(event.getFile());
    logger.info("File uploaded into MailBean: " + event.getFile());
    System.out.println("File uploaded into MailBean: " + event.getFile());
} 

<>Web.xmlfil: (Servlet 3.0)

<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>51200</param-value>
    </init-param>
    <init-param>
        <param-name>uploadDirectory</param-name>
        <param-value>c:/temp/pf</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>PrimeFaces FileUpload Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
</filter-mapping>

这一部分说,吉大港山区的错误,变成了红色,在小岛上,我得到我的印象:

Caused by: javax.faces.application.ViewExpiredException: /createmail.xhtml
           No saved view state could be found for the view identifier: /createmail.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)

我甚至用另外两种版本的Mojarra而不是Myface进行了审判,但我有错误(2.1:手里的脑膜炎被援引, 2.0.3:见到)。

问题回答

是否有jar和网吧(消除“c:......”,违约是这条路)? 我有同样的问题,但随后我重新启动了8.5轮社工作。

Im using Websphere 7 with JSF 2.0 with Mojarra 2 and PrimeFaces 3.4.2 (common-fileupload-1.2.2.jar and common-io-1.3.2.jar)

I see the fileUpload don t call the bean in WebSphere. I see the bar that load the file but don t arrive the event on the managedBean.

It seems as if some other filter in Websphere capture the HTTP request and you can t get data sent by fileUpload because are just consumed :(





相关问题
Webspehere 6.1 and JNDI for something other than a Datasource

I was wondering: how does one go about configuring WAS if they want to store some confidential information that is not datasource, JMS or Mail related? I m looking more for an adhoc JNDI resource (a ...

申 诉 Server的服务器名称或管道和港口

我们愿确定并展示一个服务器和港口,即 Java的应用程序正在运行,它落后于一个代理网络服务器。 这意味着使ServerName()返回服务器......。

Signing SOAP messages using WSS4J

We need to sign a SOAP message with a certificate in Websphere 7. Currently we are looking at using WSS4J from Apache and are approaching this in the java code itself. Does anyone have any ...

JSP files in external directory

In my project, we allow customer to write customer specific logic in JSP pages and attach to our product. Right now after deploying .ear file customer copy the custom files under /WebContent/custom ...

RAD Websphere - EAR not picking up latest jar

I am using RAD 7.0. My web application works with a jar(contains the backend code for our application) which undergoes frequent changes. But whenever I replace the jar in the WebInf/lib folder of the ...

热门标签